Skip to main content

ActionDef

Struct ActionDef 

Source
pub struct ActionDef { /* private fields */ }

Implementations§

Source§

impl ActionDef

Source

pub fn prop( duration: f32, start: f32, stop: f32, prop: Property, easing: EaseType, ) -> ActionDef

Creates a new action definition object to change a property of a node.

§Arguments
  • duration - The duration of the action.
  • start - The starting value of the property.
  • stop - The ending value of the property.
  • prop - The property to change.
  • easing - The easing function to use.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn tint( duration: f32, start: &Color3, stop: &Color3, easing: EaseType, ) -> ActionDef

Creates a new action definition object to change the color of a node.

§Arguments
  • duration - The duration of the action.
  • start - The starting color.
  • stop - The ending color.
  • easing - The easing function to use.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn roll(duration: f32, start: f32, stop: f32, easing: EaseType) -> ActionDef

Creates a new action definition object to rotate a node by smallest angle.

§Arguments
  • duration - The duration of the action.
  • start - The starting angle.
  • stop - The ending angle.
  • easing - The easing function to use.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn spawn(defs: &Vec<ActionDef>) -> ActionDef

Creates a new action definition object to run a group of actions in parallel.

§Arguments
  • defs - The actions to run in parallel.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn sequence(defs: &Vec<ActionDef>) -> ActionDef

Creates a new action definition object to run a group of actions in sequence.

§Arguments
  • defs - The actions to run in sequence.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn delay(duration: f32) -> ActionDef

Creates a new action definition object to delay the execution of following action.

§Arguments
  • duration - The duration of the delay.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn show() -> ActionDef

Creates a new action definition object to show a node.

Source

pub fn hide() -> ActionDef

Creates a new action definition object to hide a node.

Source

pub fn event(event_name: &str, msg: &str) -> ActionDef

Creates a new action definition object to emit an event.

§Arguments
  • eventName - The name of the event to emit.
  • msg - The message to send with the event.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn move_to( duration: f32, start: &Vec2, stop: &Vec2, easing: EaseType, ) -> ActionDef

Creates a new action definition object to move a node.

§Arguments
  • duration - The duration of the action.
  • start - The starting position.
  • stop - The ending position.
  • easing - The easing function to use.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn scale( duration: f32, start: f32, stop: f32, easing: EaseType, ) -> ActionDef

Creates a new action definition object to scale a node.

§Arguments
  • duration - The duration of the action.
  • start - The starting scale.
  • stop - The ending scale.
  • easing - The easing function to use.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn frame(clip_str: &str, duration: f32) -> ActionDef

Creates a new action definition object to do a frame animation. Can only be performed on a Sprite node.

§Arguments
  • clipStr - The name of the image clip, which is a sprite sheet. Can be “Image/file.png” and “Image/items.clip|itemA”. Supports image file format: jpg, png, dds, pvr, ktx.
  • duration - The duration of the action.
§Returns
  • ActionDef - A new ActionDef object.
Source

pub fn frame_with_frames( clip_str: &str, duration: f32, frames: &Vec<i32>, ) -> ActionDef

Creates a new action definition object to do a frame animation with frames count for each frame. Can only be performed on a Sprite node.

§Arguments
  • clipStr - The name of the image clip, which is a sprite sheet. Can be “Image/file.png” and “Image/items.clip|itemA”. Supports image file format: jpg, png, dds, pvr, ktx.
  • duration - The duration of the action.
  • frames - The number of frames for each frame.
§Returns
  • Action - A new Action object.

Trait Implementations§

Source§

impl Drop for ActionDef

Source§

fn drop(&mut self)

Executes the destructor for this 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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.