General > Developers Corner
Need help with a Custom Menu!!!
(1/1)
xSylar:
I am trying to make a menu and I am getting Script errors that I have no idea what they are.
here is the Code
--- Code: ---local BackGround = vgui.Create( "DFrame" )
BackGround:SetSize( 1000,500 )
BackGround:SetPos( 50,50 )
BackGround:SetTitle("Menu")
BackGround:SetDraggable( true )
BackGround:ShowCloseButton( true )
BackGround:MakePopup()
BackGround:SetVisible( true )
BackGround.Paint
draw.RoundedBox( 6, 100, 50, 100, 23, Color( 255, 255, 255, 150 ) )
--- End code ---
I dont understand really the code of the RoundedBox so i just took it off the Gmod Wiki.
Here is the errror
--- Quote ---[ERROR] lua/autorun/client/menu.lua:10: '=' expected near 'draw'
1. unknown - lua/autorun/client/menu.lua:0
--- End quote ---
Please help!!
MrPresident:
if you want to modify the paint hook of the DFrame control you have to do it inside of a function. Try this:
--- Code: ---BackGround.Paint = function()
draw.RoundedBox( 6, 100, 50, 100, 23, Color( 255, 255, 255, 150 ) )
end
--- End code ---
xSylar:
--- Quote from: MrPresident on July 22, 2013, 05:47:32 PM ---if you want to modify the paint hook of the DFrame control you have to do it inside of a function. Try this:
--- Code: ---BackGround.Paint = function()
draw.RoundedBox( 6, 100, 50, 100, 23, Color( 255, 255, 255, 150 ) )
end
--- End code ---
--- End quote ---
Thanks it helped a lot.
and you would you know how to fix a DComboBox
--- Code: ---local TestingComboBox = vgui.Create( "DComboBox", BackGround )
TestingComboBox:SetPos( 10, 35 )
TestingComboBox:SetSize( 100, 185 )
TestingComboBox:SetMultiple( false )
TestingComboBox:AddItem( "Add" ) -- Add our options
TestingComboBox:AddItem( "Some" )
TestingComboBox:AddItem( "Options" )
TestingComboBox:AddItem( "Here" )
--- End code ---
and the SetMultiple is an error
a nill value or something close to that
MrPresident:
This control was modified for GMod13.
Take a look at the official wiki.
http://wiki.garrysmod.com/page/Libraries/vgui/element/DComboBox
I can tell by the example that you used that you're using the old wiki. This one may have more documentation, but its sometimes outdated. Always check the new wiki too.
Navigation
[0] Message Index
Go to full version