Expand description
§firefly-rust
Rust SDK for making Firefly Zero games.
§Installation
cargo add firefly_rust
§Cargo features
std
: required if you don’t build your project with#![no_std]
. It will remove from the crate the custom panic handler to avoid conflicts with the standard library.alloc
: required if you want to useFileBuf
. Allows the crate to do memory allocations. If you enablealloc
but notstd
, you have to also provide a global allocator. The easiest way to do so is to activate thetalc
feature (see below).talc
: enable a global talc-powered allocator. The same as thealloc
feature but you don’t have to configure an allocator yourself.sudo
: required if you want to usesudo
module. Enables privileged access to the Firefly Zero device.nalgebra
: can be activated if you use nalgebra. Enables type conversion to and from nalgebra vectors.
§License
MIT License. You can do whatever you want with the SDK, modify it, embed into any apps and games. Have fun!
Re-exports§
pub use graphics::*;
Modules§
- Draw shapes, images, and text on the screen.
- A few useful math (trigonometric) functions for f32.
- Structs for working with shapes as values.
Structs§
- State of the buttons.
- DPad-like representation of the
Pad
. - A file loaded from ROM or data dir into the memory.
- A loaded font file.
- A finger position on the touch pad.
- The list of peers online.
Functions§
- Add a custom item on the app menu.
- Add the given value to the progress for the badge.
- Add the given score to the board.
- Write the buffer into the given file in the data dir.
- Get a file size in the data dir.
- Get the peer corresponding to the local device.
- Get the list of peers online.
- Get the progress of earning the badge.
- Get a random value.
- Get the personal best of the player.
- Read the whole file with the given name into the given buffer.
- Read the stash of the given peer using the passed buffer.
- Similar to
load_stash
but statically allocates the stash of the right size. - Log a debug message.
- Log an error message.
- Open the app menu.
- Exit the app after the current update is finished.
- Get the currently pressed buttons.
- Get the current touch pad state.
- Remove file (if exists) with the given name from the data dir.
- Remove a custom menu item with the given index.
- Save the given [
Stash
]. - Set the random seed.