pub struct Sprite {
Show 28 fields pub bbox_mode: BBoxMode, pub collision_kind: CollisionKind, pub separate_masks: bool, pub resource_sprite_type: usize, pub origin: Origin, pub pre_multiply_alpha: bool, pub edge_filtering: bool, pub collision_tolerance: u8, pub swf_precision: f64, pub bbox_left: i32, pub bbox_right: i32, pub bbox_top: i32, pub bbox_bottom: i32, pub h_tile: bool, pub v_tile: bool, pub for3d: bool, pub width: NonZeroUsize, pub height: NonZeroUsize, pub texture_group_id: TexturePath, pub swatch_colours: Value, pub grid_x: usize, pub grid_y: usize, pub frames: Vec<Frame>, pub sequence: SpriteSequence, pub layers: Vec<Layer>, pub nine_slice: Option<NineSlice>, pub resource_data: ResourceData, pub resource_type: ConstGmSprite,
}

Fields

bbox_mode: BBoxModecollision_kind: CollisionKindseparate_masks: bool
👎 Deprecated:

removed in Gms2.3.167. Instead, use PrecisePerFrame

resource_sprite_type: usize

The type of sprite, whether a bitmap or a vector sprite. Right now, we don’t handle this intelligently.

origin: Originpre_multiply_alpha: booledge_filtering: boolcollision_tolerance: u8swf_precision: f64

The precision for Vector sprites. Its default is 2.525, a number which is very odd in my opinion.

bbox_left: i32bbox_right: i32bbox_top: i32bbox_bottom: i32h_tile: boolv_tile: boolfor3d: boolwidth: NonZeroUsizeheight: NonZeroUsizetexture_group_id: TexturePath

This is the Path to the Texture Group Id.

swatch_colours: Value

This is probably always null, unless you make a swatch, but why are you doing that! Just don’t do that. Easy.

grid_x: usizegrid_y: usizeframes: Vec<Frame>

Each frame within this Sprite File.

sequence: SpriteSequence

The sequence assigned to each sprite.

layers: Vec<Layer>

Each layer within each Frame for this Sprite File. Unless users use the built-in Sprite Editor, this will likely always have a .len() of 1, as there is always one layer. Layers are shared between frames.

nine_slice: Option<NineSlice>

Optional nineslice data. Added in Gms2.3.2.556.

resource_data: ResourceData

Common resource data.

resource_type: ConstGmSprite

ModelName. Always GMSprite.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Return Sprite { bbox_mode: Default::default(), collision_kind: Default::default(), separate_masks: Default::default(), resource_sprite_type: Default::default(), origin: Default::default(), pre_multiply_alpha: Default::default(), edge_filtering: Default::default(), collision_tolerance: Default::default(), swf_precision: 2.525, bbox_left: Default::default(), bbox_right: Default::default(), bbox_top: Default::default(), bbox_bottom: Default::default(), h_tile: Default::default(), v_tile: Default::default(), for3d: Default::default(), width: NonZeroUsize :: new(1).unwrap(), height: NonZeroUsize :: new(1).unwrap(), texture_group_id: Default::default(), swatch_colours: Default::default(), grid_x: Default::default(), grid_y: Default::default(), frames: Default::default(), sequence: Default::default(), layers: Default::default(), nine_slice: Default::default(), resource_data: Default::default(), resource_type: Default::default() }

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.