pub struct Sprite {Show 14 fields
pub m_Extrude: u32,
pub m_Name: String,
pub m_Offset: Vector2f,
pub m_PixelsToUnits: f32,
pub m_RD: SpriteRenderData,
pub m_Rect: Rectf,
pub m_AtlasTags: Option<Vec<String>>,
pub m_Bones: Option<Vec<SpriteBone>>,
pub m_Border: Option<Vector4f>,
pub m_IsPolygon: Option<bool>,
pub m_PhysicsShape: Option<Vec<Vec<Vector2f>>>,
pub m_Pivot: Option<Vector2f>,
pub m_RenderDataKey: Option<(GUID, i64)>,
pub m_SpriteAtlas: Option<PPtr>,
}Expand description
Sprite is a class of the Unity engine since version 4.3.0. Exert from Unity’s scripting documentation: Represents a Sprite object for use in 2D gameplay. Sprites are 2D graphic objects used for characters, props, projectiles and other elements of 2D gameplay. The graphics are obtained from bitmap images - Texture2D. The Sprite class primarily identifies the section of the image that should be used for a specific Sprite. This information can then be used by a SpriteRenderer component on a GameObject to actually display the graphic.See Also: SpriteRenderer class.
Fields§
§m_Extrude: u32§m_Name: StringThe name of the object.
m_Offset: Vector2f§m_PixelsToUnits: f32§m_RD: SpriteRenderData§m_Rect: RectfLocation of the Sprite on the original Texture, specified in pixels.
m_AtlasTags: Option<Vec<String>>Vec
m_Bones: Option<Vec<SpriteBone>>Vec
m_Border: Option<Vector4f>Returns the border sizes of the Sprite. Vector4f: (4.5.0 - 2022.3.2f1)
m_IsPolygon: Option<bool>bool: (5.3.0f1 - 2022.3.2f1)
m_PhysicsShape: Option<Vec<Vec<Vector2f>>>Vec<Vec
m_Pivot: Option<Vector2f>Location of the Sprite’s center point in the Rect on the original Texture, specified in pixels. Vector2f: (5.4.2f2 - 2022.3.2f1)
m_RenderDataKey: Option<(GUID, i64)>(GUID, i64): (2017.1.0b1 - 2022.3.2f1)
m_SpriteAtlas: Option<PPtr>PPtr<SpriteAtlas>: (2017.1.0b1 - 2022.3.2f1)