It looks like you're new here. If you want to get involved, click one of these buttons!
heroName = TextButton.new(hero.name) -- set Pos, etc. heroName:addEventListener("click", function () local textInputDialog = TextInputDialog.new("Change Hero Name", "Enter Hero Name", hero.name, "Cancel", "Save") textInputDialog:addEventListener(Event.COMPLETE, function(event) if event.buttonIndex ~= nil then hero.name = event.text:sub(1,8) hero:save() sceneManager:changeScene(SCENE_CHOOSE_HERO, 0, TRANSITION) end end) textInputDialog:show() end) |
Comments
It basically works like a TextField (same constructor).
Typical use:
Likes: keszegh, MoKaLux, rrraptor
Fragmenter - animated loop machine and IKONOMIKON - the memory game
http://forum.giderosmobile.com/discussion/comment/63070/#Comment_63070
Also, in order to use ur class on mobiles you'll need to show a keyboard. So this: application:setKeyboardVisibility(true) will show me the keyboard, but how do I get its input?
About the tab, yes it is supposed to be supported, but I didn't check your issue yet.
1. I have application:setOrientation(Application.LANDSCAPE_LEFT) and I do application:setKeyboardVisibility(true). However the keyboard on the Android Player (didn't deploy an app) comes up in portrait mode
2. I also want to limit text length. Is a modification like this UTF8 safe? The number 11
is something that would go in with the constructor as optional