portal_figure

Crates.ioportal_figure
lib.rsportal_figure
version0.1.1
created_at2025-11-27 07:43:04.796333+00
updated_at2025-11-28 01:20:19.794053+00
descriptionA library of data relating to figures from the Skylanders series of video games.
homepage
repository
max_upload_size
id1953272
size74,899
Jeff (peabnuts123)

documentation

README

portal_figure

A library of data relating to figures from the Skylanders series of video games.

This crate is built from source: https://github.com/peabnuts123/libportalfigure

Installation

cargo add portal_figure

Usage

use portal_figure::{PORTAL_FIGURES, PortalFigure, SPYRO, find_figure};

fn main() {
    // Use `find_figure()` to look up figure data by Figure ID + Variant ID
    let figure: &PortalFigure = find_figure(0x1ce, 0x3000).expect("Couldn't find figure");
    println!(
        "{} (figure_id='0x{:x}') (variant_id='0x{:x}')",
        figure.name, figure.figure_id, figure.variant_id
    );

    // Individually exported figure data
    println!(
        "Spyro (figure_id='0x{:x}') (variant_id='0x{:x}')",
        SPYRO.figure_id, SPYRO.variant_id
    );

    // `PORTAL_FIGURES` is a &[PortalFigure] of all figures
    let all_spyros = PORTAL_FIGURES
        .iter()
        .filter(|figure| figure.name.to_lowercase().contains("spyro"))
        .collect::<Vec<&PortalFigure>>();

    println!("All Spyro figures:");
    for figure in all_spyros {
        println!(
            "{} (figure_id='0x{:x}') (variant_id='0x{:x}')",
            figure.name, figure.figure_id, figure.variant_id
        );
    }
}
Commit count: 0

cargo fmt