pub struct LuaRenderObject;Expand description
Reference to a single LuaRendering object.
Implementations§
Source§impl LuaRenderObject
impl LuaRenderObject
Sourcepub fn set_alignment(&self, value: TextAlign)
pub fn set_alignment(&self, value: TextAlign)
Set the alignment attribute (Lua: self.alignment = value).
Alignment of this text.
Sourcepub fn set_angle(&self, value: f32)
pub fn set_angle(&self, value: f32)
Set the angle attribute (Lua: self.angle = value).
Angle of this arc. Angle in radian.
Sourcepub fn set_animation(&self, value: &'static str)
pub fn set_animation(&self, value: &'static str)
Set the animation attribute (Lua: self.animation = value).
Animation prototype name of this animation.
Sourcepub fn animation_offset(&self) -> f64
pub fn animation_offset(&self) -> f64
Animation offset of this animation. Animation offset in frames.
Sourcepub fn set_animation_offset(&self, value: f64)
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.
Sourcepub fn animation_speed(&self) -> f64
pub fn animation_speed(&self) -> f64
Animation speed of this animation. Animation speed in frames per tick.
Sourcepub fn set_animation_speed(&self, value: f64)
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.
Sourcepub fn blink_interval(&self) -> u16
pub fn blink_interval(&self) -> u16
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.
Sourcepub fn set_blink_interval(&self, value: u16)
pub fn set_blink_interval(&self, value: u16)
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.
Sourcepub fn set_color(&self, value: Color)
pub fn set_color(&self, value: Color)
Set the color attribute (Lua: self.color = value).
Color or tint of the object.
Sourcepub fn dash_length(&self) -> f64
pub fn dash_length(&self) -> f64
Dash length of this line.
Sourcepub fn set_dash_length(&self, value: f64)
pub fn set_dash_length(&self, value: f64)
Set the dash_length attribute (Lua: self.dash_length = value).
Dash length of this line.
Sourcepub fn dash_offset(&self) -> f64
pub fn dash_offset(&self) -> f64
Starting offset to apply to dashes of this line. Cannot be greater than dash_length + gap_length.
Sourcepub fn set_dash_offset(&self, value: f64)
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.
Sourcepub fn draw_on_ground(&self) -> bool
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.
Sourcepub fn set_draw_on_ground(&self, value: bool)
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.
Sourcepub fn set_filled(&self, value: bool)
pub fn set_filled(&self, value: bool)
Set the filled attribute (Lua: self.filled = value).
If this circle or rectangle is filled.
Sourcepub fn set_font(&self, value: &'static str)
pub fn set_font(&self, value: &'static str)
Set the font attribute (Lua: self.font = value).
Font of this text.
Sourcepub fn forces(&self) -> Vec<LuaForce>
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.
Sourcepub fn set_forces(&self, value: ForceSet)
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.
Sourcepub fn from(&self) -> ScriptRenderTarget
pub fn from(&self) -> ScriptRenderTarget
Where this line is drawn from.
Sourcepub fn set_from(&self, value: ScriptRenderTarget)
pub fn set_from(&self, value: ScriptRenderTarget)
Set the from attribute (Lua: self.from = value).
Where this line is drawn from.
Sourcepub fn gap_length(&self) -> f64
pub fn gap_length(&self) -> f64
Length of the gaps in this line.
Sourcepub fn set_gap_length(&self, value: f64)
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.
Sourcepub fn set_intensity(&self, value: f32)
pub fn set_intensity(&self, value: f32)
Set the intensity attribute (Lua: self.intensity = value).
Intensity of this light.
Sourcepub fn left_top(&self) -> ScriptRenderTarget
pub fn left_top(&self) -> ScriptRenderTarget
Where top left corner of this rectangle is drawn.
Sourcepub fn set_left_top(&self, value: ScriptRenderTarget)
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.
Sourcepub fn light_mode(&self) -> ScriptSpriteLightMode
pub fn light_mode(&self) -> ScriptSpriteLightMode
Whether this sprite or animation should be rendered as a sprite, light or both at once.
Sourcepub fn set_light_mode(&self, value: ScriptSpriteLightMode)
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.
Sourcepub fn max_radius(&self) -> f64
pub fn max_radius(&self) -> f64
Radius of the outer edge of this arc.
Sourcepub fn set_max_radius(&self, value: f64)
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.
Sourcepub fn min_radius(&self) -> f64
pub fn min_radius(&self) -> f64
Radius of the inner edge of this arc.
Sourcepub fn set_min_radius(&self, value: f64)
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.
Sourcepub fn minimum_darkness(&self) -> f32
pub fn minimum_darkness(&self) -> f32
Minimum darkness at which this light is rendered.
Sourcepub fn set_minimum_darkness(&self, value: f32)
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.
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 only_in_alt_mode(&self) -> bool
pub fn only_in_alt_mode(&self) -> bool
If this object is only rendered in alt-mode.
Sourcepub fn set_only_in_alt_mode(&self, value: bool)
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.
Sourcepub fn orientation(&self) -> RealOrientation
pub fn orientation(&self) -> RealOrientation
Orientation of this object.
Polygon vertices that are set to an entity will ignore this.
Sourcepub fn set_orientation(&self, value: RealOrientation)
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.
Sourcepub fn orientation_target(&self) -> ScriptRenderTarget
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.
Sourcepub fn set_orientation_target(&self, value: ScriptRenderTarget)
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.
Sourcepub fn oriented(&self) -> bool
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.
Sourcepub fn set_oriented(&self, value: bool)
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.
Sourcepub fn oriented_offset(&self) -> Vector
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.
Sourcepub fn set_oriented_offset(&self, value: Vector)
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.
Sourcepub fn players(&self) -> LuaAny
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.
Sourcepub fn set_players(&self, value: LuaAny)
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.
Sourcepub fn set_radius(&self, value: f64)
pub fn set_radius(&self, value: f64)
Set the radius attribute (Lua: self.radius = value).
Radius of this circle.
Sourcepub fn render_layer(&self) -> RenderLayer
pub fn render_layer(&self) -> RenderLayer
Render layer of this sprite or animation.
Sourcepub fn set_render_layer(&self, value: RenderLayer)
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.
Sourcepub fn render_mode(&self) -> ScriptRenderMode
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.
Sourcepub fn set_render_mode(&self, value: ScriptRenderMode)
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.
Sourcepub fn right_bottom(&self) -> ScriptRenderTarget
pub fn right_bottom(&self) -> ScriptRenderTarget
Where bottom right corner of this rectangle is drawn.
Sourcepub fn set_right_bottom(&self, value: ScriptRenderTarget)
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.
Sourcepub fn set_scale(&self, value: f64)
pub fn set_scale(&self, value: f64)
Set the scale attribute (Lua: self.scale = value).
Scale of the text or light.
Sourcepub fn scale_with_zoom(&self) -> bool
pub fn scale_with_zoom(&self) -> bool
If this text scales with player zoom.
Sourcepub fn set_scale_with_zoom(&self, value: bool)
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.
Sourcepub fn sprite(&self) -> SpritePath
pub fn sprite(&self) -> SpritePath
Sprite of the sprite or light.
Sourcepub fn set_sprite(&self, value: SpritePath)
pub fn set_sprite(&self, value: SpritePath)
Set the sprite attribute (Lua: self.sprite = value).
Sprite of the sprite or light.
Sourcepub fn start_angle(&self) -> f32
pub fn start_angle(&self) -> f32
Where this arc starts. Angle in radian.
Sourcepub fn set_start_angle(&self, value: f32)
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.
Sourcepub fn surface(&self) -> LuaSurface
pub fn surface(&self) -> LuaSurface
Surface this object is rendered on.
Sourcepub fn target(&self) -> ScriptRenderTarget
pub fn target(&self) -> ScriptRenderTarget
Where this object is drawn.
Polygon vertices that are set to an entity will ignore this.
Sourcepub fn set_target(&self, value: ScriptRenderTarget)
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.
Sourcepub fn text(&self) -> LocalisedString
pub fn text(&self) -> LocalisedString
Text that is displayed by this text object.
Sourcepub fn set_text(&self, value: impl Into<LocalisedString>)
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.
Sourcepub fn time_to_live(&self) -> u32
pub fn time_to_live(&self) -> u32
Time to live of this object. This will be 0 if the object does not expire.
Sourcepub fn set_time_to_live(&self, value: u32)
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.
Sourcepub fn to(&self) -> ScriptRenderTarget
pub fn to(&self) -> ScriptRenderTarget
Where this line is drawn to.
Sourcepub fn set_to(&self, value: ScriptRenderTarget)
pub fn set_to(&self, value: ScriptRenderTarget)
Set the to attribute (Lua: self.to = value).
Where this line is drawn to.
Sourcepub fn type(&self) -> LuaRenderObjectType
pub fn type(&self) -> LuaRenderObjectType
Type of this object.
Sourcepub fn use_rich_text(&self) -> bool
pub fn use_rich_text(&self) -> bool
If this text parses rich text tags.
Sourcepub fn set_use_rich_text(&self, value: bool)
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.
Sourcepub fn use_target_orientation(&self) -> bool
pub fn use_target_orientation(&self) -> bool
If this object uses the target orientation.
Sourcepub fn set_use_target_orientation(&self, value: bool)
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.
Sourcepub fn valid(&self) -> bool
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.
Sourcepub fn vertical_alignment(&self) -> VerticalTextAlign
pub fn vertical_alignment(&self) -> VerticalTextAlign
Vertical alignment of this text.
Sourcepub fn set_vertical_alignment(&self, value: VerticalTextAlign)
pub fn set_vertical_alignment(&self, value: VerticalTextAlign)
Set the vertical_alignment attribute (Lua: self.vertical_alignment = value).
Vertical alignment of this text.
Sourcepub fn vertices(&self) -> Vec<ScriptRenderTarget>
pub fn vertices(&self) -> Vec<ScriptRenderTarget>
Vertices of this polygon.
Sourcepub fn set_vertices(&self, value: Vec<ScriptRenderTarget>)
pub fn set_vertices(&self, value: Vec<ScriptRenderTarget>)
Set the vertices attribute (Lua: self.vertices = value).
Vertices of this polygon.
Sourcepub fn set_visible(&self, value: bool)
pub fn set_visible(&self, value: bool)
Set the visible attribute (Lua: self.visible = value).
If this object is rendered to anyone at all.
Sourcepub fn set_width(&self, value: f32)
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).
Sourcepub fn set_x_scale(&self, value: f64)
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.
Sourcepub fn set_y_scale(&self, value: f64)
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.
Sourcepub fn bring_to_front(&self)
pub fn bring_to_front(&self)
Reorder this object so that it is drawn in front of the already existing objects.
Sourcepub fn move_to_back(&self)
pub fn move_to_back(&self)
Reorder this object so that it is drawn in the back of the already existing objects.
Sourcepub fn set_corners(
&self,
left_top: ScriptRenderTarget,
right_bottom: ScriptRenderTarget,
)
pub fn set_corners( &self, left_top: ScriptRenderTarget, right_bottom: ScriptRenderTarget, )
Set the corners of the rectangle with this id.
Sourcepub fn set_dashes(&self, dash_length: f64, gap_length: f64)
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
impl Clone for LuaRenderObject
Source§fn clone(&self) -> LuaRenderObject
fn clone(&self) -> LuaRenderObject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more