pub struct Face { /* private fields */ }Expand description
Represents a definition for a visual component of a game bullet or other visual item.
Implementations§
Source§impl Face
impl Face
Sourcepub fn to_node(&mut self) -> Node
pub fn to_node(&mut self) -> Node
Returns a node that can be added to a scene tree for rendering.
§Returns
Node- TheNoderepresenting thisFace.
Sourcepub fn new(face_str: &str, point: &Vec2, scale: f32, angle: f32) -> Face
pub fn new(face_str: &str, point: &Vec2, scale: f32, angle: f32) -> Face
Creates a new Face definition using the specified attributes.
§Arguments
face_str- A string for creating theFacecomponent. Could be ‘Image/file.png’ and ‘Image/items.clip|itemA’.point- The position of theFacecomponent.scale- The scale of theFacecomponent.angle- The angle of theFacecomponent.
§Returns
Face- The newFacecomponent.
Sourcepub fn with_func(
create_func: Box<dyn FnMut() -> Node>,
point: &Vec2,
scale: f32,
angle: f32,
) -> Face
pub fn with_func( create_func: Box<dyn FnMut() -> Node>, point: &Vec2, scale: f32, angle: f32, ) -> Face
Creates a new Face definition using the specified attributes.
§Arguments
create_func- A function that returns aNoderepresenting theFacecomponent.point- The position of theFacecomponent.scale- The scale of theFacecomponent.angle- The angle of theFacecomponent.
§Returns
Face- The newFacecomponent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Face
impl RefUnwindSafe for Face
impl Send for Face
impl Sync for Face
impl Unpin for Face
impl UnwindSafe for Face
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