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§
- audio
- graphics
- Draw shapes, images, and text on the screen.
- math
- A few useful math (trigonometric) functions for f32.
- shapes
- Structs for working with shapes as values.
Structs§
- Badge
- Board
- Buttons
- State of the buttons.
- DPad
- DPad-like representation of the
Pad
. - File
- A file loaded from ROM or data dir into the memory.
- Font
- A loaded font file.
- Pad
- A finger position on the touch pad.
- Peer
- Peers
- The list of peers online.
- Peers
Iter - Progress
Functions§
- add_
menu_ item - Add a custom item on the app menu.
- add_
progress - Add the given value to the progress for the badge.
- add_
score - Add the given score to the board.
- dump_
file - Write the buffer into the given file in the data dir.
- get_
file_ size - Get a file size in the data dir.
- get_me
- Get the peer corresponding to the local device.
- get_
peers - Get the list of peers online.
- get_
progress - Get the progress of earning the badge.
- get_
random - Get a random value.
- get_
score - Get the personal best of the player.
- load_
file - Read the whole file with the given name into the given buffer.
- load_
stash - Read the stash of the given peer using the passed buffer.
- load_
stash_ buf - Similar to
load_stash
but statically allocates the stash of the right size. - log_
debug - Log a debug message.
- log_
error - Log an error message.
- open_
menu - Open the app menu.
- quit
- Exit the app after the current update is finished.
- read_
buttons - Get the currently pressed buttons.
- read_
pad - Get the current touch pad state.
- remove_
file - Remove file (if exists) with the given name from the data dir.
- remove_
menu_ item - Remove a custom menu item with the given index.
- save_
stash - Save the given [
Stash
]. - set_
seed - Set the random seed.