pub struct LuaRendering;Expand description
Allows rendering of geometric shapes, text and sprites in the game world through the global object named rendering. Each render object is identified by an id that is universally unique for the lifetime of a whole game.
If an entity target of an object (except its orientation_target) is destroyed or changes surface, then the object is also destroyed.
Implementations§
Source§impl LuaRendering
impl LuaRendering
Sourcepub fn object_name(&self) -> &'static str
pub fn object_name(&self) -> &'static str
The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
Sourcepub fn draw_animation(
&self,
params: LuaRenderingDrawAnimationParams,
) -> LuaRenderObject
pub fn draw_animation( &self, params: LuaRenderingDrawAnimationParams, ) -> LuaRenderObject
Create an animation.
Sourcepub fn draw_arc(&self, params: LuaRenderingDrawArcParams) -> LuaRenderObject
pub fn draw_arc(&self, params: LuaRenderingDrawArcParams) -> LuaRenderObject
Create an arc.
Sourcepub fn draw_circle(
&self,
params: LuaRenderingDrawCircleParams,
) -> LuaRenderObject
pub fn draw_circle( &self, params: LuaRenderingDrawCircleParams, ) -> LuaRenderObject
Create a circle.
Sourcepub fn draw_light(&self, params: LuaRenderingDrawLightParams) -> LuaRenderObject
pub fn draw_light(&self, params: LuaRenderingDrawLightParams) -> LuaRenderObject
Create a gradient light which is not occluded by any sprites. It is rendered at lower resolution, so it takes less GPU power. The same technique is used for lights drawn by LightDefinition.
The base game uses the utility sprites light_medium and light_small for lights.
Sourcepub fn draw_line(&self, params: LuaRenderingDrawLineParams) -> LuaRenderObject
pub fn draw_line(&self, params: LuaRenderingDrawLineParams) -> LuaRenderObject
Create a line.
Sourcepub fn draw_polygon(
&self,
params: LuaRenderingDrawPolygonParams,
) -> LuaRenderObject
pub fn draw_polygon( &self, params: LuaRenderingDrawPolygonParams, ) -> LuaRenderObject
Create a triangle mesh defined by a triangle strip.
Sourcepub fn draw_rectangle(
&self,
params: LuaRenderingDrawRectangleParams,
) -> LuaRenderObject
pub fn draw_rectangle( &self, params: LuaRenderingDrawRectangleParams, ) -> LuaRenderObject
Create a rectangle.
Sourcepub fn draw_sprite(
&self,
params: LuaRenderingDrawSpriteParams,
) -> LuaRenderObject
pub fn draw_sprite( &self, params: LuaRenderingDrawSpriteParams, ) -> LuaRenderObject
Create a sprite.
Sourcepub fn draw_text(&self, params: LuaRenderingDrawTextParams) -> LuaRenderObject
pub fn draw_text(&self, params: LuaRenderingDrawTextParams) -> LuaRenderObject
Create a text.
Not all fonts support scaling.
Sourcepub fn get_all_objects(
&self,
mod_name: Option<&'static str>,
) -> Vec<LuaRenderObject>
pub fn get_all_objects( &self, mod_name: Option<&'static str>, ) -> Vec<LuaRenderObject>
Gets an array of all valid objects.
Sourcepub fn get_object_by_id(&self, object_id: u64) -> Option<LuaRenderObject>
pub fn get_object_by_id(&self, object_id: u64) -> Option<LuaRenderObject>
Gives LuaRenderObject for given object ID. May return nil if object does not exist or is invalid.
Trait Implementations§
Source§impl Clone for LuaRendering
impl Clone for LuaRendering
Source§fn clone(&self) -> LuaRendering
fn clone(&self) -> LuaRendering
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more