Struct rust_animation::actor::Actor

source ·
pub struct Actor {
Show 19 fields pub name: String, pub x: i32, pub y: i32, pub z: f32, pub width: u32, pub height: u32, pub anchor_x: f32, pub anchor_y: f32, pub scale_x: f32, pub scale_y: f32, pub rotation: i32, pub visible: bool, pub image_path: String, pub sub_actor_list: Vec<Actor>, pub animated: bool, pub animation: Option<Animation>, pub needs_update: bool, pub node: Option<Node>, pub style: Option<Style>, /* private fields */
}

Fields§

§name: String§x: i32§y: i32§z: f32§width: u32§height: u32§anchor_x: f32§anchor_y: f32§scale_x: f32§scale_y: f32§rotation: i32§visible: bool§image_path: String§sub_actor_list: Vec<Actor>§animated: bool§animation: Option<Animation>§needs_update: bool§node: Option<Node>§style: Option<Style>

Implementations§

source§

impl Actor

source

pub fn new( name: String, w: u32, h: u32, event_handler: Option<Box<dyn EventHandler>> ) -> Self

source

pub fn init_gl(&mut self)

source

pub fn set_color(&mut self, r: f32, g: f32, b: f32)

source

pub fn set_image(&mut self, path: String)

source

pub fn set_layout(&mut self, layout: Option<Box<dyn Layout>>)

source

pub fn set_animation(&mut self, animation: Option<Animation>)

source

pub fn set_style(&mut self, style: Style)

source

pub fn set_visible(&mut self, visible: bool)

source

pub fn animate(&mut self)

source

pub fn select_next_sub_actor(&mut self)

source

pub fn select_prev_sub_actor(&mut self)

source

pub fn set_focus(&mut self, focused: bool)

source

pub fn handle_input(&mut self, key: Key)

source

pub fn layout_sub_actors( &mut self, parent_actor: Option<&Actor>, stretch: &mut Option<Stretch> )

source

pub fn update_layout(&mut self, stretch: &mut Option<Stretch>)

source

pub fn finalize_layout(&mut self)

source

pub fn model_matrix(&self) -> Matrix4<f32>

source

pub fn render( &mut self, shader_program: GLuint, parent_model_matrix: Option<&Matrix4<f32>>, projection: &Matrix4<f32> )

source

pub fn add_sub_actor(&mut self, actor: Actor)

Auto Trait Implementations§

§

impl !RefUnwindSafe for Actor

§

impl !Send for Actor

§

impl !Sync for Actor

§

impl Unpin for Actor

§

impl !UnwindSafe for Actor

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.