flipper-zero-tutorials/ui/viewport_demo
2023-06-01 17:16:55 -05:00
..
application.fam Simple ViewPort demo - Hello World 2023-06-01 17:16:55 -05:00
demo.c Simple ViewPort demo - Hello World 2023-06-01 17:16:55 -05:00
icon.png Simple ViewPort demo - Hello World 2023-06-01 17:16:55 -05:00
README.md Simple ViewPort demo - Hello World 2023-06-01 17:16:55 -05:00

viewport demo

This is a UI demo of the ViewPort class. It is based off the wiki code for the [ViewPort] https://github.com/jamisonderek/flipper-zero-tutorials/wiki/User-Interface#viewport section of the User-Interface page.

The draw callback does some basic text drawing on a Canvas.

The input callback changes the X and Y position of a cursor "^" based on the key that is pressed. You can see that when the ViewPort orientation is rotated, both the screen and the keypress is translated automatically. Pressing the back button uses a Message Queue to signal that application should exit.