Hello. I have a simple question:
How can you input text trought allegro?
If you didn't understand what i was meaning, imagine that in my game the user has to write a name for his game caracter. I need my game to detect when a key is pressed and if that key is between A - Z and a - z the program to add that caracter to a string varible. I was thinking of using the event system and somehow detect the keyboard keycode, but I don't know if the keycode is like the codes in the ASCII table. I want to use 100% allegro beause I can port it to other platforms.
Any help would be welcome!
The easiest way is to find a gui library you like (there's a few). Or you can use the ALLEGRO_EVENT_KEY_CHAR and the unichar field to get the unicode character (and use the allegro unicode string api).
This is some 'orrible code that works from an old game of mine,
That really is 'orrible! Never share that snippet with anyone ever again!
'Orrible but it works, I guess it's the hacker in me.
Can anyone recommend a GUI library? I need it to work on Android and IOS also
My GUI API Agui is used in the popular game Factorio: http://www.factorio.com/ and I have been using it for years.
I am currently porting my game to ios and in doing so I am adding some touch compatibility. I have obj-c classes to do keyboard support in ios too.
There's also:
GWEN https://github.com/garrynewman/GWEN
TGUI2 http://nooskewl.ca/more/open-source/