Struct yy_typings::sprite_yy::Sprite
source · [−]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: BBoxMode
collision_kind: CollisionKind
separate_masks: bool
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: Origin
pre_multiply_alpha: bool
edge_filtering: bool
collision_tolerance: u8
swf_precision: f64
The precision for Vector sprites. Its default is 2.525
, a number
which is very odd in my opinion.
bbox_left: i32
bbox_right: i32
bbox_top: i32
bbox_bottom: i32
h_tile: bool
v_tile: bool
for3d: bool
width: NonZeroUsize
height: NonZeroUsize
texture_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: usize
grid_y: usize
frames: 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
sourceimpl Default for Sprite
impl Default for Sprite
sourcefn default() -> Self
fn default() -> Self
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() }
sourceimpl<'de> Deserialize<'de> for Sprite
impl<'de> Deserialize<'de> for Sprite
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Sprite
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more