mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-24 09:40:52 +00:00
|
|
||
|---|---|---|
| .. | ||
| locales | ||
| src | ||
| ball_screenshot.png | ||
| Cargo.toml | ||
| README.md | ||
Ball
A simple demo application that mainly demonstrates how to integrate into the Xous framework, but without much emphasis on I/O.
A ball bounces around, changing directions randomly whenever it hits a border. Pressing any key will pop up a modal dialog box that informs you of the key pressed, and then gives you an option to change the behavior into a "tilt" driven mode where the gyro is read and used to control the ball's motion.
This is a fairly "raw iron" demo, and would be a reasonable starting point for someone who, for example, wants to write a video game.
Copying This App
- Add a UX context by editing
services/gam/src/lib.rs/EXPECTED_BOOT_CONTEXTS - Copy this demo application, and rename the relevant structures in its
Cargo.tomlandmain.rs. - Add it to the Workspace
default-membersandmembersarrays by editing./Cargo.toml - Add it to the build by editing
xtask/src/main.rsand inserting it into the relevant descriptor. Typically, you would insert your app into thehw_pkgsarray, as this is what is built and targeted for full hardware builds. Most of the other trimmed-down descriptors are for debug, emulation, and benchmarking. - (optional) You may also need to run
cargo xtask generate-localesif you modify/add any internationalization strings. - Add entries to the app switching menu.
services/status/src/appmenu.rsto add the menu item (pluslocales/i18n.jsonin the status directory if you want translated names for the app), andservices/status/src/main.rsto add the Opcode (inside theStatusOpcodestruct, around line 55) and the actual operation itself (in the mainloop, around line 670).
