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 angle(&self) -> f32

Angle of this arc. Angle in radian.

Source

pub fn animation(&self) -> &str

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 animation_speed(&self) -> f64

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.

Source

pub fn color(&self) -> Color

Color or tint of the object.

Source

pub fn dash_length(&self) -> f64

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 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 filled(&self) -> bool

If this circle or rectangle is filled.

Source

pub fn font(&self) -> &str

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 from(&self) -> LuaAny

Where this line is drawn from.

Source

pub fn gap_length(&self) -> f64

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 left_top(&self) -> LuaAny

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 max_radius(&self) -> f64

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 minimum_darkness(&self) -> f32

Minimum darkness at which this light is rendered.

Source

pub fn object_name(&self) -> &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 orientation(&self) -> LuaAny

Orientation of this object.

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

Source

pub fn orientation_target(&self) -> LuaAny

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 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 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 radius(&self) -> f64

Radius of this circle.

Source

pub fn render_layer(&self) -> LuaAny

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 right_bottom(&self) -> LuaAny

Where bottom right corner of this rectangle is drawn.

Source

pub fn scale(&self) -> f64

Scale of the text or light.

Source

pub fn scale_with_zoom(&self) -> bool

If this text scales with player zoom.

Source

pub fn sprite(&self) -> SpritePath

Sprite of the sprite or light.

Source

pub fn start_angle(&self) -> f32

Where this arc starts. Angle in radian.

Source

pub fn surface(&self) -> LuaSurface

Surface this object is rendered on.

Source

pub fn target(&self) -> LuaAny

Where this object is drawn.

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

Source

pub fn text(&self) -> &str

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 to(&self) -> LuaAny

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 use_target_orientation(&self) -> bool

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 vertices(&self) -> Vec<LuaAny>

Vertices of this polygon.

Source

pub fn visible(&self) -> bool

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 x_scale(&self) -> f64

Horizontal scale of this sprite or animation.

Source

pub fn y_scale(&self) -> f64

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: LuaAny, right_bottom: LuaAny)

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 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.