Dlabel problem

So i’m currently busy with creating an own custom roleplay gamemode. I made a little script wich makes a DFrame pop-up on spawn. It should say some text, but the DLabel only let me see a little part from it.

function SpawnMenu()
	local Frame = vgui.Create( "DFrame" )
	Frame:SetPos( 0, 0 )
	Frame:SetSize( ScrW() * 1.0, ScrH() * 1.0 )
	Frame:SetTitle( "" )
	Frame:SetVisible( true )
	Frame:SetDraggable( false )
	Frame:ShowCloseButton( false )
	Frame.Paint = function( self, w, h ) -- 'function Frame:Paint( w, h )' works too
	draw.RoundedBox( 0, 0, 0, w, h, Color( 61, 61, 61, 255 ) )
	if Frame:IsValid() then 
		timer.Simple( 5, function() Frame:Close() end )
	local DLabel = vgui.Create( "DLabel", Frame )
	DLabel:SetPos( ScrW()/2, ScrH()/2 )
	DLabel:SetText( "Welcome on my own custom gamemode! Player data is being loaded!" )
usermessage.Hook( "SpawnMenu", SpawnMenu )

It’s shows me only = Welco…

Kind regards,


This is unrelated, but you might want to try out docking since it can make positioning/sizing panels far less annoying.

Also, you need to use

DLabel:SetAutoStretchVertical as well as SizeToContents, since the height doesn’t get auto-corrected (at least according to the wiki)

I’ve added DLabel:SizeToContents() but didn’t work

It does only show the W from Welcome and three dots after it.

Have you read the text on the page I linked? Post the new code?

I’m retarted, didn’t see the Notice bar. Thanks anyway