pub struct Sprite {Show 19 fields
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>,
/* private fields */
}
Fields§
§id: SpriteID
§name: String
§filename: String
§slp_id: Option<GraphicID>
The SLP resource ID for this sprite.
is_loaded: bool
§layer: 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: u16
§transparent_selection: bool
§bounding_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: u8
§mirror_flag: i8
§deltas: Vec<SpriteDelta>
§attack_sounds: Vec<SpriteAttackSound>