pub enum Facing {
Down,
Up,
Left,
Right,
}Expand description
Which way an entity faces. Art is drawn facing right: the system
nadir::animate mirrors the Sprite of an entity that faces left
(flip.x), and unmirrors it whichever other way it faces. Only the
entity’s own Sprite: a Parent’s children need their own.
It is simulation state, reflected: set it in fixed systems. Set in a frame system, it mirrors the Sprite from the next frame.
Variants§
Down
Toward +Y, down the screen.
Up
Toward −Y, up the screen.
Left
Toward −X: the Sprite is mirrored.
Right
Toward +X, as the art is drawn.
Trait Implementations§
impl Component for Facing
impl Copy for Facing
impl Eq for Facing
Source§impl FromValue for Facing
impl FromValue for Facing
Source§const TYPE_NAME: &'static str = "Facing"
const TYPE_NAME: &'static str = "Facing"
The type’s name, as
Reflect::type_name gives it.Source§fn from_value(
value: &Value,
cx: &mut ReflectContext<'_>,
) -> Result<Self, ReflectError>
fn from_value( value: &Value, cx: &mut ReflectContext<'_>, ) -> Result<Self, ReflectError>
Makes a value of the type from
value. Read moreSource§impl Reflect for Facing
impl Reflect for Facing
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
The type’s name: for the macros’ types, its name as written
(
Health), which prefabs and saves use.Source§fn kind(&self) -> ReflectKind
fn kind(&self) -> ReflectKind
What sort of value it is.
Source§fn fields(&self) -> &'static [FieldInfo]
fn fields(&self) -> &'static [FieldInfo]
The fields of a struct, in order; none for other kinds.
Source§fn variants(&self) -> &'static [&'static str]
fn variants(&self) -> &'static [&'static str]
The variants of an enum, by name, in order, as data writes them:
what an inspector offers to pick from. None for other kinds, and by
default:
reflect_enum! gives its enum’s.Source§fn field(&self, _index: usize) -> Option<&dyn Reflect>
fn field(&self, _index: usize) -> Option<&dyn Reflect>
Field
index of a struct, or element index of a list or an
option.Source§fn field_mut(&mut self, _index: usize) -> Option<&mut dyn Reflect>
fn field_mut(&mut self, _index: usize) -> Option<&mut dyn Reflect>
Field or element
index, to change it.Source§fn apply_value(
&mut self,
value: &Value,
cx: &mut ReflectContext<'_>,
) -> Result<(), ReflectError>
fn apply_value( &mut self, value: &Value, cx: &mut ReflectContext<'_>, ) -> Result<(), ReflectError>
Sets the value from
value. A field that value does not name
keeps its value; a field it names that the type does not have is a
warning. On an error, what was applied before it stays applied. Read moreimpl StructuralPartialEq for Facing
Auto Trait Implementations§
impl Forget for Facing
impl Freeze for Facing
impl Move for Facing
impl RefUnwindSafe for Facing
impl Send for Facing
impl Sync for Facing
impl Unpin for Facing
impl UnsafeUnpin for Facing
impl UnwindSafe for Facing
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