Skip to main content

LuaRenderObject

Struct LuaRenderObject 

Source
pub struct LuaRenderObject;
Expand description

Reference to a single LuaRendering object.

Implementations§

Source§

impl LuaRenderObject

Source

pub fn alignment(&self) -> TextAlign

Alignment of this text.

Source

pub fn set_alignment(&self, value: TextAlign)

Set the alignment attribute (Lua: self.alignment = value).

Alignment of this text.

Source

pub fn angle(&self) -> f32

Angle of this arc. Angle in radian.

Source

pub fn set_angle(&self, value: f32)

Set the angle attribute (Lua: self.angle = value).

Angle of this arc. Angle in radian.

Source

pub fn animation(&self) -> &'static str

Animation prototype name of this animation.

Source

pub fn set_animation(&self, value: &'static str)

Set the animation attribute (Lua: self.animation = value).

Animation prototype name of this animation.

Source

pub fn animation_offset(&self) -> f64

Animation offset of this animation. Animation offset in frames.

Source

pub fn set_animation_offset(&self, value: f64)

Set the animation_offset attribute (Lua: self.animation_offset = value).

Animation offset of this animation. Animation offset in frames.

Source

pub fn animation_speed(&self) -> f64

Animation speed of this animation. Animation speed in frames per tick.

Source

pub fn set_animation_speed(&self, value: f64)

Set the animation_speed attribute (Lua: self.animation_speed = value).

Animation speed of this animation. Animation speed in frames per tick.

Blink interval of this object based on the internal “update tick”. When zero, blinking is disabled. For other values, the object will be visible the given number of ticks and then invisible for the same duration. Objects with the same blink interval will blink synchronously. Blink interval of game alerts is 30.

For example, when the interval is 60, the object is visible for 60 ticks and hidden for the next 60.

Set the blink_interval attribute (Lua: self.blink_interval = value).

Blink interval of this object based on the internal “update tick”. When zero, blinking is disabled. For other values, the object will be visible the given number of ticks and then invisible for the same duration. Objects with the same blink interval will blink synchronously. Blink interval of game alerts is 30.

For example, when the interval is 60, the object is visible for 60 ticks and hidden for the next 60.

Source

pub fn color(&self) -> Color

Color or tint of the object.

Source

pub fn set_color(&self, value: Color)

Set the color attribute (Lua: self.color = value).

Color or tint of the object.

Source

pub fn dash_length(&self) -> f64

Dash length of this line.

Source

pub fn set_dash_length(&self, value: f64)

Set the dash_length attribute (Lua: self.dash_length = value).

Dash length of this line.

Source

pub fn dash_offset(&self) -> f64

Starting offset to apply to dashes of this line. Cannot be greater than dash_length + gap_length.

Source

pub fn set_dash_offset(&self, value: f64)

Set the dash_offset attribute (Lua: self.dash_offset = value).

Starting offset to apply to dashes of this line. Cannot be greater than dash_length + gap_length.

Source

pub fn draw_on_ground(&self) -> bool

If this object is being drawn on the ground, under most entities and sprites.

In render_mode == “chart”, this value is unused.

Source

pub fn set_draw_on_ground(&self, value: bool)

Set the draw_on_ground attribute (Lua: self.draw_on_ground = value).

If this object is being drawn on the ground, under most entities and sprites.

In render_mode == “chart”, this value is unused.

Source

pub fn filled(&self) -> bool

If this circle or rectangle is filled.

Source

pub fn set_filled(&self, value: bool)

Set the filled attribute (Lua: self.filled = value).

If this circle or rectangle is filled.

Source

pub fn font(&self) -> &'static str

Font of this text.

Source

pub fn set_font(&self, value: &'static str)

Set the font attribute (Lua: self.font = value).

Font of this text.

Source

pub fn forces(&self) -> Vec<LuaForce>

Forces for which this object is rendered or nil if visible to all forces. Writing nil or empty array will make this object visible to all forces.

Source

pub fn set_forces(&self, value: ForceSet)

Set the forces attribute (Lua: self.forces = value).

Forces for which this object is rendered or nil if visible to all forces. Writing nil or empty array will make this object visible to all forces.

Source

pub fn from(&self) -> ScriptRenderTarget

Where this line is drawn from.

Source

pub fn set_from(&self, value: ScriptRenderTarget)

Set the from attribute (Lua: self.from = value).

Where this line is drawn from.

Source

pub fn gap_length(&self) -> f64

Length of the gaps in this line.

Source

pub fn set_gap_length(&self, value: f64)

Set the gap_length attribute (Lua: self.gap_length = value).

Length of the gaps in this line.

Source

pub fn id(&self) -> u64

Unique identifier of this render object.

Source

pub fn intensity(&self) -> f32

Intensity of this light.

Source

pub fn set_intensity(&self, value: f32)

Set the intensity attribute (Lua: self.intensity = value).

Intensity of this light.

Source

pub fn left_top(&self) -> ScriptRenderTarget

Where top left corner of this rectangle is drawn.

Source

pub fn set_left_top(&self, value: ScriptRenderTarget)

Set the left_top attribute (Lua: self.left_top = value).

Where top left corner of this rectangle is drawn.

Source

pub fn light_mode(&self) -> ScriptSpriteLightMode

Whether this sprite or animation should be rendered as a sprite, light or both at once.

Source

pub fn set_light_mode(&self, value: ScriptSpriteLightMode)

Set the light_mode attribute (Lua: self.light_mode = value).

Whether this sprite or animation should be rendered as a sprite, light or both at once.

Source

pub fn max_radius(&self) -> f64

Radius of the outer edge of this arc.

Source

pub fn set_max_radius(&self, value: f64)

Set the max_radius attribute (Lua: self.max_radius = value).

Radius of the outer edge of this arc.

Source

pub fn min_radius(&self) -> f64

Radius of the inner edge of this arc.

Source

pub fn set_min_radius(&self, value: f64)

Set the min_radius attribute (Lua: self.min_radius = value).

Radius of the inner edge of this arc.

Source

pub fn minimum_darkness(&self) -> f32

Minimum darkness at which this light is rendered.

Source

pub fn set_minimum_darkness(&self, value: f32)

Set the minimum_darkness attribute (Lua: self.minimum_darkness = value).

Minimum darkness at which this light is rendered.

Source

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.

Source

pub fn only_in_alt_mode(&self) -> bool

If this object is only rendered in alt-mode.

Source

pub fn set_only_in_alt_mode(&self, value: bool)

Set the only_in_alt_mode attribute (Lua: self.only_in_alt_mode = value).

If this object is only rendered in alt-mode.

Source

pub fn orientation(&self) -> RealOrientation

Orientation of this object.

Polygon vertices that are set to an entity will ignore this.

Source

pub fn set_orientation(&self, value: RealOrientation)

Set the orientation attribute (Lua: self.orientation = value).

Orientation of this object.

Polygon vertices that are set to an entity will ignore this.

Source

pub fn orientation_target(&self) -> ScriptRenderTarget

Target to which this object rotates so that it faces the target. Note that orientation is still applied to the object. Writing nil will clear the orientation_target. nil if no target.

Polygon vertices that are set to an entity will ignore this.

Source

pub fn set_orientation_target(&self, value: ScriptRenderTarget)

Set the orientation_target attribute (Lua: self.orientation_target = value).

Target to which this object rotates so that it faces the target. Note that orientation is still applied to the object. Writing nil will clear the orientation_target. nil if no target.

Polygon vertices that are set to an entity will ignore this.

Source

pub fn oriented(&self) -> bool

If this light is rendered with the same orientation as the target entity. Note that orientation is still applied to the sprite.

Source

pub fn set_oriented(&self, value: bool)

Set the oriented attribute (Lua: self.oriented = value).

If this light is rendered with the same orientation as the target entity. Note that orientation is still applied to the sprite.

Source

pub fn oriented_offset(&self) -> Vector

Offsets the center of the sprite or animation if orientation_target is given. This offset will rotate together with the sprite or animation.

Source

pub fn set_oriented_offset(&self, value: Vector)

Set the oriented_offset attribute (Lua: self.oriented_offset = value).

Offsets the center of the sprite or animation if orientation_target is given. This offset will rotate together with the sprite or animation.

Source

pub fn players(&self) -> LuaAny

Players for which this object is visible or nil if visible to all players. Writing nil or empty array will make this object visible to all players.

Source

pub fn set_players(&self, value: LuaAny)

Set the players attribute (Lua: self.players = value).

Players for which this object is visible or nil if visible to all players. Writing nil or empty array will make this object visible to all players.

Source

pub fn radius(&self) -> f64

Radius of this circle.

Source

pub fn set_radius(&self, value: f64)

Set the radius attribute (Lua: self.radius = value).

Radius of this circle.

Source

pub fn render_layer(&self) -> RenderLayer

Render layer of this sprite or animation.

Source

pub fn set_render_layer(&self, value: RenderLayer)

Set the render_layer attribute (Lua: self.render_layer = value).

Render layer of this sprite or animation.

Source

pub fn render_mode(&self) -> ScriptRenderMode

Whether the object is rendered in game world or on the chart (map view).

When it is changed, the object is pushed to front of its new group.

Source

pub fn set_render_mode(&self, value: ScriptRenderMode)

Set the render_mode attribute (Lua: self.render_mode = value).

Whether the object is rendered in game world or on the chart (map view).

When it is changed, the object is pushed to front of its new group.

Source

pub fn right_bottom(&self) -> ScriptRenderTarget

Where bottom right corner of this rectangle is drawn.

Source

pub fn set_right_bottom(&self, value: ScriptRenderTarget)

Set the right_bottom attribute (Lua: self.right_bottom = value).

Where bottom right corner of this rectangle is drawn.

Source

pub fn scale(&self) -> f64

Scale of the text or light.

Source

pub fn set_scale(&self, value: f64)

Set the scale attribute (Lua: self.scale = value).

Scale of the text or light.

Source

pub fn scale_with_zoom(&self) -> bool

If this text scales with player zoom.

Source

pub fn set_scale_with_zoom(&self, value: bool)

Set the scale_with_zoom attribute (Lua: self.scale_with_zoom = value).

If this text scales with player zoom.

Source

pub fn sprite(&self) -> SpritePath

Sprite of the sprite or light.

Source

pub fn set_sprite(&self, value: SpritePath)

Set the sprite attribute (Lua: self.sprite = value).

Sprite of the sprite or light.

Source

pub fn start_angle(&self) -> f32

Where this arc starts. Angle in radian.

Source

pub fn set_start_angle(&self, value: f32)

Set the start_angle attribute (Lua: self.start_angle = value).

Where this arc starts. Angle in radian.

Source

pub fn surface(&self) -> LuaSurface

Surface this object is rendered on.

Source

pub fn target(&self) -> ScriptRenderTarget

Where this object is drawn.

Polygon vertices that are set to an entity will ignore this.

Source

pub fn set_target(&self, value: ScriptRenderTarget)

Set the target attribute (Lua: self.target = value).

Where this object is drawn.

Polygon vertices that are set to an entity will ignore this.

Source

pub fn text(&self) -> LocalisedString

Text that is displayed by this text object.

Source

pub fn set_text(&self, value: impl Into<LocalisedString>)

Set the text attribute (Lua: self.text = value).

Text that is displayed by this text object.

Source

pub fn time_to_live(&self) -> u32

Time to live of this object. This will be 0 if the object does not expire.

Source

pub fn set_time_to_live(&self, value: u32)

Set the time_to_live attribute (Lua: self.time_to_live = value).

Time to live of this object. This will be 0 if the object does not expire.

Source

pub fn to(&self) -> ScriptRenderTarget

Where this line is drawn to.

Source

pub fn set_to(&self, value: ScriptRenderTarget)

Set the to attribute (Lua: self.to = value).

Where this line is drawn to.

Source

pub fn type(&self) -> LuaRenderObjectType

Type of this object.

Source

pub fn use_rich_text(&self) -> bool

If this text parses rich text tags.

Source

pub fn set_use_rich_text(&self, value: bool)

Set the use_rich_text attribute (Lua: self.use_rich_text = value).

If this text parses rich text tags.

Source

pub fn use_target_orientation(&self) -> bool

If this object uses the target orientation.

Source

pub fn set_use_target_orientation(&self, value: bool)

Set the use_target_orientation attribute (Lua: self.use_target_orientation = value).

If this object uses the target orientation.

Source

pub fn valid(&self) -> bool

Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.

Source

pub fn vertical_alignment(&self) -> VerticalTextAlign

Vertical alignment of this text.

Source

pub fn set_vertical_alignment(&self, value: VerticalTextAlign)

Set the vertical_alignment attribute (Lua: self.vertical_alignment = value).

Vertical alignment of this text.

Source

pub fn vertices(&self) -> Vec<ScriptRenderTarget>

Vertices of this polygon.

Source

pub fn set_vertices(&self, value: Vec<ScriptRenderTarget>)

Set the vertices attribute (Lua: self.vertices = value).

Vertices of this polygon.

Source

pub fn visible(&self) -> bool

If this object is rendered to anyone at all.

Source

pub fn set_visible(&self, value: bool)

Set the visible attribute (Lua: self.visible = value).

If this object is rendered to anyone at all.

Source

pub fn width(&self) -> f32

Width of the object. Value is in pixels (32 per tile).

Source

pub fn set_width(&self, value: f32)

Set the width attribute (Lua: self.width = value).

Width of the object. Value is in pixels (32 per tile).

Source

pub fn x_scale(&self) -> f64

Horizontal scale of this sprite or animation.

Source

pub fn set_x_scale(&self, value: f64)

Set the x_scale attribute (Lua: self.x_scale = value).

Horizontal scale of this sprite or animation.

Source

pub fn y_scale(&self) -> f64

Vertical scale of this sprite or animation.

Source

pub fn set_y_scale(&self, value: f64)

Set the y_scale attribute (Lua: self.y_scale = value).

Vertical scale of this sprite or animation.

Source

pub fn bring_to_front(&self)

Reorder this object so that it is drawn in front of the already existing objects.

Source

pub fn destroy(&self)

Destroys this object. Does not error when the object is invalid.

Source

pub fn move_to_back(&self)

Reorder this object so that it is drawn in the back of the already existing objects.

Source

pub fn set_corners( &self, left_top: ScriptRenderTarget, right_bottom: ScriptRenderTarget, )

Set the corners of the rectangle with this id.

Source

pub fn set_dashes(&self, dash_length: f64, gap_length: f64)

Set the length of the dashes and the length of the gaps in this line.

Trait Implementations§

Source§

impl Clone for LuaRenderObject

Source§

fn clone(&self) -> LuaRenderObject

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LuaRenderObject

Source§

impl Debug for LuaRenderObject

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for LuaRenderObject

Source§

fn default() -> LuaRenderObject

Returns the “default value” for a type. Read more
Source§

impl Eq for LuaRenderObject

Source§

impl From<LuaRenderObject> for LuaAny

Source§

fn from(_: LuaRenderObject) -> Self

Converts to this type from the input type.
Source§

impl From<LuaRenderObject> for RegistrationTarget

Source§

fn from(value: LuaRenderObject) -> Self

Converts to this type from the input type.
Source§

impl LuaObject for LuaRenderObject

Source§

impl PartialEq for LuaRenderObject

Source§

fn eq(&self, other: &LuaRenderObject) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LuaRenderObject

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.