pub struct Image {Show 17 fields
pub pos: Vec3,
pub hw: Vec2,
pub uv: Vec4,
pub color: Color,
pub frames: Vec2,
pub switch_time: u32,
pub animate: bool,
pub camera_type: CameraType,
pub texture: Option<usize>,
pub store_id: Index,
pub order: DrawOrder,
pub render_layer: u32,
pub bounds: Option<Bounds>,
pub flip_style: FlipStyle,
pub rotation_angle: f32,
pub order_override: Option<Vec3>,
pub changed: bool,
}Expand description
Basic and Fast Image Rendering Type. Best used for Sprites and Objects in the world.
Fields§
§pos: Vec3Position of the object
hw: Vec2Height and Width
uv: Vec4Static texture offsets or animation frame positions
color: ColorColor.
frames: Vec2frames, frames_per_row: this will cycle thru frames per row at the uv start.
switch_time: u32in millsecs 1000 = 1sec
animate: boolturn on animation if set.
camera_type: CameraTypeGlobal Camera the Shader will use to render the object with
texture: Option<usize>Texture area location in Atlas.
store_id: IndexBuffer’s store Index.
order: DrawOrderOrdering Type, used to order the Stores in the buffers.
render_layer: u32Layer this type is rendering on.
bounds: Option<Bounds>Clip bounds if enabled in the renderer.
flip_style: FlipStyleDirectional Flip.
rotation_angle: f32direct angle of rotation from the center Axis.
order_override: Option<Vec3>Overides the absolute order values based on position.
changed: boolWhen true tells system to update the buffers.
Implementations§
Source§impl Image
impl Image
Sourcepub fn new(
texture: Option<usize>,
renderer: &mut GpuRenderer,
render_layer: u32,
) -> Self
pub fn new( texture: Option<usize>, renderer: &mut GpuRenderer, render_layer: u32, ) -> Self
Creates a new Image with rendering layer.
Sourcepub fn unload(&self, renderer: &mut GpuRenderer)
pub fn unload(&self, renderer: &mut GpuRenderer)
Unloads the Image from the Instance Buffers Store.
Sourcepub fn set_order_override(&mut self, order_override: Option<Vec3>) -> &mut Self
pub fn set_order_override(&mut self, order_override: Option<Vec3>) -> &mut Self
Updates the Image’s order_override.
Sourcepub fn update_bounds(&mut self, bounds: Option<Bounds>) -> &mut Self
pub fn update_bounds(&mut self, bounds: Option<Bounds>) -> &mut Self
Updates the Image’s Optional Clipping Bounds.
Sourcepub fn set_flip_style(&mut self, flip_style: FlipStyle) -> &mut Self
pub fn set_flip_style(&mut self, flip_style: FlipStyle) -> &mut Self
Sourcepub fn set_rotation_angle(&mut self, rotation_angle: f32) -> &mut Self
pub fn set_rotation_angle(&mut self, rotation_angle: f32) -> &mut Self
Updates the Image’s rotation.
Sourcepub fn set_frames(&mut self, frames: Vec2) -> &mut Self
pub fn set_frames(&mut self, frames: Vec2) -> &mut Self
Updates the Image’s animation frames.
Sourcepub fn set_animate(&mut self, animate: bool) -> &mut Self
pub fn set_animate(&mut self, animate: bool) -> &mut Self
Updates the Image’s animate boolean.
Sourcepub fn set_render_layer(&mut self, render_layer: u32) -> &mut Self
pub fn set_render_layer(&mut self, render_layer: u32) -> &mut Self
Updates the Image’s rendering layer.
Sourcepub fn set_texture(&mut self, texture: Option<usize>) -> &mut Self
pub fn set_texture(&mut self, texture: Option<usize>) -> &mut Self
Updates the Image’s Texture ID.
Sourcepub fn set_camera_type(&mut self, camera_type: CameraType) -> &mut Self
pub fn set_camera_type(&mut self, camera_type: CameraType) -> &mut Self
Updates the Image’s CameraType.
Sourcepub fn set_switch_time(&mut self, switch_time: u32) -> &mut Self
pub fn set_switch_time(&mut self, switch_time: u32) -> &mut Self
Updates the Image’s animation switch time.
Sourcepub fn update(
&mut self,
renderer: &mut GpuRenderer,
atlas: &mut AtlasSet,
) -> OrderedIndex
pub fn update( &mut self, renderer: &mut GpuRenderer, atlas: &mut AtlasSet, ) -> OrderedIndex
Used to check and update the vertex array.
Returns a OrderedIndex used in Rendering.
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more