Skip to main content

Sprite

Struct Sprite 

Source
pub struct Sprite {
Show 80 fields pub image_id: Option<ImageId>, pub mask_image_id: Option<ImageId>, pub mask_offset_x: i32, pub mask_offset_y: i32, pub tonecurve_image_id: Option<ImageId>, pub tonecurve_row: f32, pub tonecurve_sat: f32, pub fit: SpriteFit, pub size_mode: SpriteSizeMode, pub visible: bool, pub alpha: u8, pub x: i32, pub y: i32, pub z: f32, pub scale_x: f32, pub scale_y: f32, pub scale_z: f32, pub rotate: f32, pub rotate_x: f32, pub rotate_y: f32, pub pivot_x: f32, pub pivot_y: f32, pub pivot_z: f32, pub object_anchor: bool, pub texture_center_x: f32, pub texture_center_y: f32, pub camera_enabled: bool, pub camera_eye: [f32; 3], pub camera_target: [f32; 3], pub camera_up: [f32; 3], pub camera_view_angle_deg: f32, pub culling: bool, pub alpha_test: bool, pub alpha_blend: bool, pub fog_use: bool, pub light_no: i32, pub light_enabled: bool, pub light_diffuse: [f32; 4], pub light_ambient: [f32; 4], pub light_specular: [f32; 4], pub light_factor: f32, pub light_kind: i32, pub light_pos: [f32; 4], pub light_dir: [f32; 4], pub light_atten: [f32; 4], pub light_cone: [f32; 4], pub mesh_runtime_lights: Vec<SpriteRuntimeLight>, pub fog_enabled: bool, pub fog_color: [f32; 4], pub fog_near: f32, pub fog_far: f32, pub fog_scroll_x: f32, pub fog_texture_image_id: Option<ImageId>, pub world_no: i32, pub billboard: bool, pub mesh_file_name: Option<String>, pub mesh_animation: MeshAnimationState, pub mesh_kind: u8, pub shadow_cast: bool, pub shadow_receive: bool, pub wipe_fx_mode: u8, pub wipe_fx_params: [f32; 4], pub wipe_src_image_id: Option<ImageId>, pub tr: u8, pub mono: u8, pub reverse: u8, pub bright: u8, pub dark: u8, pub color_rate: u8, pub color_add_r: u8, pub color_add_g: u8, pub color_add_b: u8, pub color_r: u8, pub color_g: u8, pub color_b: u8, pub mask_mode: u8, pub blend: SpriteBlend, pub dst_clip: Option<ClipRect>, pub src_clip: Option<ClipRect>, pub order: i32,
}

Fields§

§image_id: Option<ImageId>§mask_image_id: Option<ImageId>§mask_offset_x: i32§mask_offset_y: i32§tonecurve_image_id: Option<ImageId>§tonecurve_row: f32§tonecurve_sat: f32§fit: SpriteFit§size_mode: SpriteSizeMode§visible: bool§alpha: u8§x: i32§y: i32§z: f32§scale_x: f32§scale_y: f32§scale_z: f32§rotate: f32§rotate_x: f32§rotate_y: f32§pivot_x: f32§pivot_y: f32§pivot_z: f32§object_anchor: bool

Siglus object sprites use OBJECT.X/Y as the render anchor. For G00/PCT object resources, vertices are offset by OBJECT.CENTER plus the texture center stored in the cut metadata. Runtime helper sprites keep this off and continue to use x/y as a top-left pixel rectangle.

§texture_center_x: f32§texture_center_y: f32§camera_enabled: bool§camera_eye: [f32; 3]§camera_target: [f32; 3]§camera_up: [f32; 3]§camera_view_angle_deg: f32§culling: bool§alpha_test: bool§alpha_blend: bool§fog_use: bool§light_no: i32§light_enabled: bool§light_diffuse: [f32; 4]§light_ambient: [f32; 4]§light_specular: [f32; 4]§light_factor: f32§light_kind: i32§light_pos: [f32; 4]§light_dir: [f32; 4]§light_atten: [f32; 4]§light_cone: [f32; 4]§mesh_runtime_lights: Vec<SpriteRuntimeLight>§fog_enabled: bool§fog_color: [f32; 4]§fog_near: f32§fog_far: f32§fog_scroll_x: f32§fog_texture_image_id: Option<ImageId>§world_no: i32§billboard: bool§mesh_file_name: Option<String>§mesh_animation: MeshAnimationState§mesh_kind: u8

0 = regular sprite or 2D camera quad, 1 = static mesh, 2 = billboard mesh, 3 = skinned mesh.

§shadow_cast: bool§shadow_receive: bool§wipe_fx_mode: u8

Runtime wipe/effect family applied by the renderer. 0=none, 1=mosaic, 2=raster_h, 3=raster_v, 4=explosion_blur, 5=shimi, 6=shimi_inv, 10=cross_mosaic, 11=cross_raster_h, 12=cross_raster_v, 13=cross_explosion_blur.

§wipe_fx_params: [f32; 4]§wipe_src_image_id: Option<ImageId>

Optional secondary source texture for dual-source wipe/effect composition.

§tr: u8§mono: u8§reverse: u8§bright: u8§dark: u8§color_rate: u8§color_add_r: u8§color_add_g: u8§color_add_b: u8§color_r: u8§color_g: u8§color_b: u8§mask_mode: u8

0 = off, 1 = use luminance as alpha, 2 = use texture alpha.

§blend: SpriteBlend§dst_clip: Option<ClipRect>§src_clip: Option<ClipRect>§order: i32

Render order within a layer (ascending).

Trait Implementations§

Source§

impl Clone for Sprite

Source§

fn clone(&self) -> Sprite

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Sprite

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Sprite

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,