pub struct Transform {
pub position: Vec2,
}Expand description
Where an entity is, in world pixels (+Y down), as the last tick left it. For a sprite, it is where its pivot is: its feet.
Fields§
§position: Vec2The entity’s position.
Implementations§
Trait Implementations§
impl Component for Transform
impl Copy for Transform
Source§impl FromValue for Transform
impl FromValue for Transform
Source§const TYPE_NAME: &'static str = "Transform"
const TYPE_NAME: &'static str = "Transform"
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 Transform
impl Reflect for Transform
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 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 moreSource§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.impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Forget for Transform
impl Freeze for Transform
impl Move for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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