• Dlabel problem
    5 replies, posted
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. [CODE]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:MakePopup() 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 ) ) end if Frame:IsValid() then timer.Simple( 5, function() Frame:Close() end ) 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!" ) end usermessage.Hook( "SpawnMenu", SpawnMenu )[/CODE] It's shows me only = Welco... Kind regards, Koen
[url]http://wiki.garrysmod.com/page/Panel/SizeToContents[/url]
This is unrelated, but you might want to try out [URL="https://wiki.garrysmod.com/page/Panel/Dock"]docking[/URL] since it can make positioning/sizing panels far less annoying. Also, you need to use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/DLabel/SetAutoStretchVertical]DLabel:SetAutoStretchVertical[/url] 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
Sorry, you need to Log In to post a reply to this thread.