pub struct Sprite {
pub transform: Transform,
/* private fields */
}Fields§
§transform: TransformImplementations§
Source§impl Sprite
impl Sprite
Sourcepub fn new(
albedo: TextureInput,
height: TextureInput,
roughness: TextureInput,
normal: NormalInput,
program: &mut LumenpyxProgram,
transform: Transform,
) -> (Sprite, TextureHandle, TextureHandle, TextureHandle, TextureHandle)
pub fn new( albedo: TextureInput, height: TextureInput, roughness: TextureInput, normal: NormalInput, program: &mut LumenpyxProgram, transform: Transform, ) -> (Sprite, TextureHandle, TextureHandle, TextureHandle, TextureHandle)
returns a tuple of the sprite and the texture handles for albedo, height, roughness, and normal textures in that order
pub fn set_shadow_strength(&mut self, strength: f32)
pub fn free_all_textures(&self, program: &mut LumenpyxProgram)
Trait Implementations§
Source§impl Drawable for Sprite
impl Drawable for Sprite
Source§fn get_recieve_shadows_strength(&self) -> f32
fn get_recieve_shadows_strength(&self) -> f32
0.0 is no shadows, 1.0 is full shadows
fn draw_albedo( &self, program: &LumenpyxProgram, transform: &Transform, albedo_framebuffer: &mut SimpleFrameBuffer<'_>, )
fn draw_height( &self, program: &LumenpyxProgram, transform: &Transform, height_framebuffer: &mut SimpleFrameBuffer<'_>, )
fn draw_normal( &self, program: &LumenpyxProgram, transform: &Transform, normal_framebuffer: &mut SimpleFrameBuffer<'_>, )
fn draw_roughness( &self, program: &LumenpyxProgram, transform: &Transform, roughness_framebuffer: &mut SimpleFrameBuffer<'_>, )
Source§fn try_load_shaders(&self, program: &mut LumenpyxProgram)
fn try_load_shaders(&self, program: &mut LumenpyxProgram)
Load the shaders for the object
This is called every frame, so make sure to check
if the shader is already loaded or your performance will suffer
fn get_transform(&self) -> Transform
fn set_transform(&mut self, transform: Transform)
impl Copy for Sprite
Auto Trait Implementations§
impl Freeze for Sprite
impl RefUnwindSafe for Sprite
impl Send for Sprite
impl Sync for Sprite
impl Unpin for Sprite
impl UnwindSafe for Sprite
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Content for Twhere
T: Copy,
impl<T> Content for Twhere
T: Copy,
Source§unsafe fn read<F, E>(size: usize, f: F) -> Result<T, E>
unsafe fn read<F, E>(size: usize, f: F) -> Result<T, E>
Prepares an output buffer, then turns this buffer into an
Owned.
User-provided closure F must only write to and not read from &mut Self.Source§fn get_elements_size() -> usize
fn get_elements_size() -> usize
Returns the size of each element.
Source§fn to_void_ptr(&self) -> *const ()
fn to_void_ptr(&self) -> *const ()
Produces a pointer to the data.
Source§fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>
fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>
Builds a pointer to this type from a raw pointer.
Source§fn is_size_suitable(size: usize) -> bool
fn is_size_suitable(size: usize) -> bool
Returns true if the size is suitable to store a type like this.
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>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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.Source§fn as_any(&self) -> &(dyn Any + 'static)
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.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
Converts
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>
Converts
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