Struct ascending_graphics::Rect
source · pub struct Rect {Show 14 fields
pub position: Vec3,
pub size: Vec2,
pub color: Color,
pub image: Option<usize>,
pub uv: Vec4,
pub border_width: f32,
pub border_color: Color,
pub radius: f32,
pub use_camera: bool,
pub store_id: Index,
pub order: DrawOrder,
pub render_layer: u32,
pub bounds: Option<Bounds>,
pub changed: bool,
}Fields§
§position: Vec3§size: Vec2§color: Color§image: Option<usize>§uv: Vec4§border_width: f32§border_color: Color§radius: f32§use_camera: bool§store_id: Index§order: DrawOrder§render_layer: u32§bounds: Option<Bounds>§changed: boolif anything got updated we need to update the buffers too.
Implementations§
source§impl Rect
impl Rect
pub fn new(renderer: &mut GpuRenderer, render_layer: u32) -> Self
pub fn update_bounds(&mut self, bounds: Option<Bounds>)
pub fn set_use_camera(&mut self, use_camera: bool) -> &mut Self
pub fn set_color(&mut self, color: Color) -> &mut Self
pub fn set_border_color(&mut self, color: Color) -> &mut Self
pub fn set_texture( &mut self, renderer: &GpuRenderer, atlas: &mut AtlasSet, path: String ) -> Result<&mut Self, GraphicsError>
pub fn set_container_uv(&mut self, uv: Vec4) -> &mut Self
pub fn set_position(&mut self, position: Vec3) -> &mut Self
pub fn set_size(&mut self, size: Vec2) -> &mut Self
pub fn set_border_width(&mut self, size: f32) -> &mut Self
pub fn set_radius(&mut self, radius: f32) -> &mut Self
pub fn create_quad(&mut self, renderer: &mut GpuRenderer, atlas: &mut AtlasSet)
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 ShapeVertex array.
pub fn check_mouse_bounds(&self, mouse_pos: Vec2) -> bool
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnwindSafe for Rect
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> 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.