• 2 Text Entries in a panel
    2 replies, posted
Making a sort of character sheet for RP. Here is what I have so far: [IMG]http://cloud.steampowered.com/ugc/524906243900177806/1AFFF7AF956E6CBED05A06478EF9F3C91F7800EC/[/IMG] As you can see I want to have 2 text boxes for Character Details and Character Name, both parented to the same panel. But it won't seem to let me. Am I doing something wrong? I was thinking about making 2 other panels inside and then holding the text boxes in there, but whenever I parent a panel to another panel it makes it go into full screen sort of and takes up all the space inside of the parent panel, overriding any size changes. [CODE] include ( 'shared.lua' ) function main_menu() local mainMenu = vgui.Create( "DFrame" ) mainMenu:SetSize( 620, 710 ) mainMenu:SetTitle( "Herb Roleplaying" ) mainMenu:SetVisible( true ) mainMenu:SetDraggable( false ) mainMenu:ShowCloseButton ( false ) mainMenu:MakePopup() mainMenu:Center() local PropertySheet = vgui.Create( "DPropertySheet" ) PropertySheet:SetParent( mainMenu ) PropertySheet:SetSize( 600, 640 ) PropertySheet:Center() local CharacterSheetBox = vgui.Create( "DPanel" , PropertySheet) CharacterSheetBox:SetPos( 25, 50 ) CharacterSheetBox:SetSize( 50, 50 ) CharacterSheetBox.Paint = function() -- Paint function surface.SetDrawColor( 50, 50, 50, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel surface.DrawRect( 0, 0, CharacterSheetBox:GetWide(), CharacterSheetBox:GetTall() ) -- Draw the rect end -- Character Name local CharacterNameLabel = vgui.Create( "Label", CharacterSheetBox ) CharacterNameLabel:SetPos( 7, 8 ) CharacterNameLabel:SetText( "Character Name:" ) CharacterNameLabel:SizeToContents() local CharacterName = vgui.Create( "DTextEntry", CharacterSheetBox ) CharacterName:SetPos( 120, 5 ) CharacterName:SetTall( 20 ) CharacterName:SetWide( 450 ) CharacterName:SetEnterAllowed( true ) -- Character Details local CharacterDetailLabel = vgui.Create( "Label", CharacterSheetBox ) CharacterDetailLabel:SetPos( 7, 32 ) CharacterDetailLabel:SetText( "Character Details:" ) CharacterDetailLabel:SizeToContents() local CharacterDetail = vgui.Create( "DTextEntry", CharacterSheetBox ) CharacterName:SetPos( 120, 20 ) CharacterName:SetTall( 20 ) CharacterName:SetWide( 450 ) CharacterName:SetEnterAllowed( true ) PropertySheet:AddSheet( "Character", CharacterSheetBox, "gui/silkicons/user", false, false, "All general info on your character." ) PropertySheet:AddSheet( "Server Rules", CharacterDetail, "gui/silkicons/group", false, false, "The rules of the server." ) end concommand.Add( "main_menu", main_menu ) [/CODE] Thanks.
[code] local Character[B]Detail[/B] = vgui.Create( "DTextEntry", CharacterSheetBox ) Character[B]Name[/B]:SetPos( 120, 20 ) Character[B]Name[/B]:SetTall( 20 ) Character[B]Name[/B]:SetWide( 450 ) Character[B]Name[/B]:SetEnterAllowed( true ) [/code] copy paste = bad
[QUOTE=TylerB;34985712][code] local Character[B]Detail[/B] = vgui.Create( "DTextEntry", CharacterSheetBox ) Character[B]Name[/B]:SetPos( 120, 20 ) Character[B]Name[/B]:SetTall( 20 ) Character[B]Name[/B]:SetWide( 450 ) Character[B]Name[/B]:SetEnterAllowed( true ) [/code] copy paste = bad[/QUOTE] I can't believe I missed that. Upon fixing it to change the properties of CharacterDetail, the Characterdetail text entry doesn't show up at all now. Only the name text box shows up :L
Sorry, you need to Log In to post a reply to this thread.