TinyCircuits / TinyCircuits-Tiny-Game-Engine

MicroPython game engine for TinyCircuits Thumby Color
GNU General Public License v3.0
9 stars 1 forks source link

Reimplemented buttons. #42

Closed TPReal closed 3 months ago

TPReal commented 3 months ago

Buttons are now instances of a Button class, with attributes allowing getting their state and parameters. So instead of engine_io.check_just_pressed(engine_io.DPAD_UP), the call is now engine_io.UP.is_pressed. Added support for detecting long presses, double presses and autorepeated presses (not actually implemented yet) on the API level. Shortened button names. Updated all uses in C and Python code.

TinyCircuits commented 3 months ago

Thanks! This was a decent amount of work. I compiled this for both platforms and it works fine.

The new functions are very useful.