Best way to receive input text?

200 views
Skip to first unread message

James Wood

unread,
Jul 24, 2014, 11:47:08 AM7/24/14
to haxef...@googlegroups.com
I am new to haxeflixel and I'm using sublimetext 2 on OSX. I want to create an easy way for the designer I'm working with to edit some variables during play, a la Unity's inspector. 

After searching the api I decided the best approach would be to use the FlxInputText class. At the top of my PlayState.hx file I attempt to import flixel.addons.ui.FlxInputText. 

Whenever I try to test it using neko I get the error: Class not found : flixel.addons.ui.FlxInputText. I was hoping someone could help me either with importing the FlxInputText class or by showing me a better way to get input from the user.

Thank you : )

James

Gama11

unread,
Jul 24, 2014, 1:18:03 PM7/24/14
to haxef...@googlegroups.com
This functionality is already supported by the flixel debugger (and straightforward to use), no need to reinvent the wheel. There are two ways you can do this:

- Add a variable to the watch window via FlxG.watch.add() - then you can click on the textfield that displays the value and edit it
- Use the 'set' command of the console - example: 'set FlxG.state.sprite.x 500'

James Wood

unread,
Jul 24, 2014, 1:20:14 PM7/24/14
to haxef...@googlegroups.com
Thank you for the quick solution. This is exactly what I am looking for. Have a good day. : )
Reply all
Reply to author
Forward
0 new messages