Re: Goo: Gui and Animation library.
Posted: Thu Jun 02, 2011 7:52 pm
Hey there seems to be a problem with Goo textinput's
when i try to save the text from the textinput to a variable it just doesn't save.
when i try to save the text from the textinput to a variable it just doesn't save.
Code: Select all
function Menu:enterState()
local panel = goo.panel:new()
panel:setPos( 30, 30 )
panel:setSize( 200, 200 )
panel:setDraggable(false)
panel:showCloseButton(false)
panel:setTitle( 'Main menu' )
local nick = goo.textinput:new( panel )
nick:setPos( 10, 20 )
nick:setText( 'Anon' )
nick:setSize( 100, 15)
local ip = goo.textinput:new( panel )
ip:setPos( 10, 45 )
ip:setText( '127.0.0.1' )
ip:setSize( 100, 15)
local play = goo.button:new( panel )
play:setPos( 10, 75 )
play:setText( 'Play' )
play:sizeToText()
play.onClick = function( self, button )
obj:gotoState('Game')
nickname = nick:getText()
ip = ip:getText()
panel:destroy()
end
end