Struct ark_api::world::Render

source ·
pub struct Render { /* private fields */ }
Expand description

Render component.

Lets you configure the look of a entity by assigning a mesh. Usually accessed through entity.render().

Implementations§

source§

impl Render

source

pub fn shape(&self) -> ValueAccessorDataReadWrite<Shape>

Returns a ValueAccessor for the shape used by the entity.

Used to set/get the shape. Sets which render shape is attached to the render component of this entity (assuming it has one).

source

pub fn mesh(&self) -> ValueAccessorDataReadWrite<WorldMesh>

Returns a ValueAccessor for the mesh used by the entity.

Used to set the mesh Sets which mesh is attached to the render component of this entity (assuming it has one).

source

pub fn mesh_style(&self) -> ValueAccessorReadWrite<Option<MeshStyle>>

Returns a ValueAccessor for the optional mesh style.

Used to set/get the mesh style. See MeshStyle.

source

pub fn visible(&self) -> ValueAccessorReadWrite<bool>

Controls whether the entity will be rendered or not.

source

pub fn player_id_set(&self) -> ValueAccessorDataReadWrite<PlayerIdSet>

Returns a ValueAccessor for the set of player ids this mesh should be displayed for.

Used to set/get the player id set. Sets which player id set is attached to the render component of this entity (assuming it has one).

source

pub fn dynamic_module_data(&self) -> ValueAccessorDataReadWrite<BinaryData>

Returns a ValueAccessor for setting dynamic data that is passed to the render module. Data is expected to be of type “Binary”

Used to set/get the dynamic data. The dynamic data is only used if the render component has the Shape RenderModule.

source

pub fn non_uniform_scale(&self) -> ValueAccessorReadWriteAnimate<Vec3>

Returns a ValueAccessor for the non-uniform scale applied before rendering.

Used to set/get the scale.

source

pub fn set_mesh(&self, mesh: WorldMesh)

Used to set a mesh that this render component should render.

Trait Implementations§

source§

impl ComponentTrait for Render

source§

fn get_type() -> ComponentType

The type of the component, as a ComponentType enum.
source§

fn from_entity(handle: Entity) -> Self

Adopt an Entity, wrap in a component struct.
source§

fn try_from_entity(handle: Entity) -> Option<Self>

Try to adopt an Entity, wrapping it in a component struct.
source§

fn entity(&self) -> Entity

Get the entity that the component belongs to.
source§

impl Debug for Render

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.

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.