[Solved] Using io.read without blocking the game ?
Posted: Mon Feb 10, 2014 11:11 am
Hi lövers !
Do you know any way to use io.read() without blocking the game ? I have a console attached to my game and want the player to be able to enter commands in it while playing (to connect to a multiplayer server, change skin, etc... this will avoid me to overcharge my game with a UI layer).
When I use io.read(), it blocks everything and waits for the player input. It's fairly normal when you think about it twice, but how to do this the async way ? (always listen for user's input, and call a callback function when he has entered something)
Thanks guys
Do you know any way to use io.read() without blocking the game ? I have a console attached to my game and want the player to be able to enter commands in it while playing (to connect to a multiplayer server, change skin, etc... this will avoid me to overcharge my game with a UI layer).
When I use io.read(), it blocks everything and waits for the player input. It's fairly normal when you think about it twice, but how to do this the async way ? (always listen for user's input, and call a callback function when he has entered something)
Thanks guys