Crate earthbound_battle_backgrounds

Crate earthbound_battle_backgrounds 

Source
Expand description

§EarthBound Battle Backgrounds

This crate emulates the battle background animations from EarthBound / Mother 2.

This crate started as a direct port of Earthbound Battle Backgrounds JS, which is in turn a port of Kraken.

§Usage

use earthbound_battle_backgrounds::{Emulator, Options, SNES_WIDTH, SNES_HEIGHT};

let mut emulator = Emulator::new(Options::default());

// Obtain an RGBA pixel buffer from your windowing system.
let mut pixels: Vec<u8> = vec![0; usize::from(SNES_WIDTH * SNES_HEIGHT) * 4];

// Call every time a new frame is required.
emulator.draw_frame(&mut pixels);

Structs§

Emulator
Handles rendering of the battle backgrounds.
Layers
Layer styles.
Options
Configuration options.

Enums§

AspectRatio
Aspect ratio used to render a frame. If a value other than Self::Full is used, the resulting image will have letterboxing applied.

Constants§

MAX_LAYER
The maximum layer ID.
SNES_HEIGHT
Width of the SNES screen in pixels.
SNES_WIDTH
Height of the SNES screen in pixels.