[][src]Struct genie_dat::Sprite

pub struct Sprite {
    pub id: SpriteID,
    pub name: String,
    pub filename: String,
    pub slp_id: Option<GraphicID>,
    pub is_loaded: bool,
    pub layer: u8,
    pub color_table: u16,
    pub transparent_selection: bool,
    pub bounding_box: (i16, i16, i16, i16),
    pub sound_id: Option<SoundID>,
    pub num_frames: u16,
    pub num_angles: u16,
    pub base_speed: f32,
    pub frame_rate: f32,
    pub replay_delay: f32,
    pub sequence_type: u8,
    pub mirror_flag: i8,
    pub deltas: Vec<SpriteDelta>,
    pub attack_sounds: Vec<SpriteAttackSound>,
    // some fields omitted
}

Fields

id: SpriteIDname: Stringfilename: Stringslp_id: Option<GraphicID>

The SLP resource ID for this sprite.

is_loaded: boollayer: u8

The layer describes order of graphics being rendered. Possible values: 0 (lowest layer) to 40 (highest layer) Graphics on a higher layer will be rendered above graphics of a lower layer. If graphics share the same layer, graphics will be displayed dependend on their map positions.

Draw Level

0   Terrain
5   Shadows, farms
6   Rubble
10   Constructions, corpses, shadows, flowers, ruins
11   Fish
19   Rugs, craters
20   Buildings, units, damage flames, mill animation
21   Blacksmith smoke
22   Hawk
30   Projectiles, explosions
color_table: u16transparent_selection: boolbounding_box: (i16, i16, i16, i16)sound_id: Option<SoundID>num_frames: u16

Number of frames per angle animation

num_angles: u16

Number of angles tored in slp and also the number of extra structures. If there are more than 1 angle, AngleCount/2 - 1 frames will be mirrored. That means angles starting from south going clockwise to north are stored and the others will be mirrored.

base_speed: f32

If this is over 0, the speed of the unit will be replaced with this.

frame_rate: f32

Frame rate in seconds. (Delay between frames)

replay_delay: f32

Time to wait until the animation sequence is started again.

sequence_type: u8mirror_flag: i8deltas: Vec<SpriteDelta>attack_sounds: Vec<SpriteAttackSound>

Implementations

impl Sprite[src]

pub fn read_from(input: impl Read) -> Result<Self>[src]

pub fn write_to<W: Write>(&self, output: &mut W) -> Result<()>[src]

Trait Implementations

impl Clone for Sprite[src]

impl Debug for Sprite[src]

impl Default for Sprite[src]

Auto Trait Implementations

impl RefUnwindSafe for Sprite

impl Send for Sprite

impl Sync for Sprite

impl Unpin for Sprite

impl UnwindSafe for Sprite

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.