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 is destroyed or changes surface, then the object is also destroyed.
draw_line{color=…, width=…, gap_length?=…, dash_length?=…, dash_offset?=…, from=…, from_offset?=…, to=…, to_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…} | → uint64 |
Create a line. |
Create a line. |
||
draw_text{text=…, surface=…, target=…, target_offset?=…, color=…, scale?=…, font?=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, orientation?=…, alignment?=…, vertical_alignment?=…, scale_with_zoom?=…, only_in_alt_mode?=…, use_rich_text?=…} | → uint64 |
Create a text. |
Create a text. |
||
draw_circle{color=…, radius=…, width?=…, filled=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…} | → uint64 |
Create a circle. |
Create a circle. |
||
draw_rectangle{color=…, width?=…, filled=…, left_top=…, left_top_offset?=…, right_bottom=…, right_bottom_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…} | → uint64 |
Create a rectangle. |
Create a rectangle. |
||
draw_arc{color=…, max_radius=…, min_radius=…, start_angle=…, angle=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…} | → uint64 |
Create an arc. |
Create an arc. |
||
draw_polygon{color=…, vertices=…, target?=…, target_offset?=…, orientation?=…, orientation_target?=…, orientation_target_offset?=…, use_target_orientation?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…} | → uint64 |
Create a triangle mesh defined by a triangle strip. |
Create a triangle mesh defined by a triangle strip. |
||
draw_sprite{sprite=…, orientation?=…, x_scale?=…, y_scale?=…, tint?=…, render_layer?=…, orientation_target?=…, orientation_target_offset?=…, use_target_orientation?=…, oriented_offset?=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, only_in_alt_mode?=…} | → uint64 |
Create a sprite. |
Create a sprite. |
||
draw_light{sprite=…, orientation?=…, scale?=…, intensity?=…, minimum_darkness?=…, oriented?=…, color?=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, only_in_alt_mode?=…} | → uint64 |
Create a light. |
Create a light. |
||
draw_animation{animation=…, orientation?=…, x_scale?=…, y_scale?=…, tint?=…, render_layer?=…, animation_speed?=…, animation_offset?=…, orientation_target?=…, orientation_target_offset?=…, use_target_orientation?=…, oriented_offset?=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, only_in_alt_mode?=…} | → uint64 |
Create an animation. |
Create an animation. |
||
destroy(id) |
Destroy the object with the given id. |
|
Destroy the object with the given id. |
||
is_font_valid(font_name) | → boolean |
Does a font with this name exist? |
Does a font with this name exist? |
||
is_valid(id) | → boolean |
Does a valid object with this id exist? |
Does a valid object with this id exist? |
||
get_all_ids(mod_name?) | → array[uint64] |
Gets an array of all valid object ids. |
Gets an array of all valid object ids. |
||
clear(mod_name?) |
Destroys all render objects. |
|
Destroys all render objects. |
||
get_type(id) | → string |
Gets the type of the given object. |
Gets the type of the given object. |
||
bring_to_front(id) |
Reorder this object so that it is drawn in front of the already existing objects. |
|
Reorder this object so that it is drawn in front of the already existing objects. |
||
get_surface(id) | → LuaSurface |
The surface the object with this id is rendered on. |
The surface the object with this id is rendered on. |
||
get_time_to_live(id) | → uint |
Get the time to live of the object with this id. |
Get the time to live of the object with this id. |
||
set_time_to_live(id, time_to_live) |
Set the time to live of the object with this id. |
|
Set the time to live of the object with this id. |
||
get_forces(id) | → array[LuaForce]? |
Get the forces that the object with this id is rendered to or |
Get the forces that the object with this id is rendered to or |
||
set_forces(id, forces) |
Set the forces that the object with this id is rendered to. |
|
Set the forces that the object with this id is rendered to. |
||
get_players(id) | → array[LuaPlayer]? |
Get the players that the object with this id is rendered to or |
Get the players that the object with this id is rendered to or |
||
set_players(id, players) |
Set the players that the object with this id is rendered to. |
|
Set the players that the object with this id is rendered to. |
||
get_visible(id) | → boolean |
Get whether this is rendered to anyone at all. |
Get whether this is rendered to anyone at all. |
||
set_visible(id, visible) |
Set whether this is rendered to anyone at all. |
|
Set whether this is rendered to anyone at all. |
||
get_draw_on_ground(id) | → boolean |
Get whether this is being drawn on the ground, under most entities and sprites. |
Get whether this is being drawn on the ground, under most entities and sprites. |
||
set_draw_on_ground(id, draw_on_ground) |
Set whether this is being drawn on the ground, under most entities and sprites. |
|
Set whether this is being drawn on the ground, under most entities and sprites. |
||
get_only_in_alt_mode(id) | → boolean |
Get whether this is only rendered in alt-mode. |
Get whether this is only rendered in alt-mode. |
||
set_only_in_alt_mode(id, only_in_alt_mode) |
Set whether this is only rendered in alt-mode. |
|
Set whether this is only rendered in alt-mode. |
||
get_use_target_orientation(id) | → boolean |
Get whether this uses the target orientation. |
Get whether this uses the target orientation. |
||
set_use_target_orientation(id, use_target_orientation) |
Set whether this uses the target orientation. |
|
Set whether this uses the target orientation. |
||
get_color(id) | → Color? |
Get the color or tint of the object with this id. |
Get the color or tint of the object with this id. |
||
set_color(id, color) |
Set the color or tint of the object with this id. |
|
Set the color or tint of the object with this id. |
||
get_width(id) | → float? |
Get the width of the object with this id. |
Get the width of the object with this id. |
||
set_width(id, width) |
Set the width of the object with this id. |
|
Set the width of the object with this id. |
||
get_from(id) | → ScriptRenderTarget? |
Get from where the line with this id is drawn. |
Get from where the line with this id is drawn. |
||
set_from(id, from, from_offset?) |
Set from where the line with this id is drawn. |
|
Set from where the line with this id is drawn. |
||
get_to(id) | → ScriptRenderTarget? |
Get where the line with this id is drawn to. |
Get where the line with this id is drawn to. |
||
set_to(id, to, to_offset?) |
Set where the line with this id is drawn to. |
|
Set where the line with this id is drawn to. |
||
get_dash_length(id) | → double? |
Get the dash length of the line with this id. |
Get the dash length of the line with this id. |
||
set_dash_length(id, dash_length) |
Set the dash length of the line with this id. |
|
Set the dash length of the line with this id. |
||
get_gap_length(id) | → double? |
Get the length of the gaps in the line with this id. |
Get the length of the gaps in the line with this id. |
||
set_gap_length(id, gap_length) |
Set the length of the gaps in the line with this id. |
|
Set the length of the gaps in the line with this id. |
||
set_dashes(id, dash_length, gap_length) |
Set the length of the dashes and the length of the gaps in the line with this id. |
|
Set the length of the dashes and the length of the gaps in the line with this id. |
||
get_target(id) | → ScriptRenderTarget? |
Get where the object with this id is drawn. |
Get where the object with this id is drawn. |
||
set_target(id, target, target_offset?) |
Set where the object with this id is drawn. |
|
Set where the object with this id is drawn. |
||
get_orientation(id) | → RealOrientation? |
Get the orientation of the object with this id. |
Get the orientation of the object with this id. |
||
set_orientation(id, orientation) |
Set the orientation of the object with this id. |
|
Set the orientation of the object with this id. |
||
get_scale(id) | → double? |
Get the scale of the text or light with this id. |
Get the scale of the text or light with this id. |
||
set_scale(id, scale) |
Set the scale of the text or light with this id. |
|
Set the scale of the text or light with this id. |
||
get_text(id) | → LocalisedString? |
Get the text that is displayed by the text with this id. |
Get the text that is displayed by the text with this id. |
||
set_text(id, text) |
Set the text that is displayed by the text with this id. |
|
Set the text that is displayed by the text with this id. |
||
get_font(id) | → string? |
Get the font of the text with this id. |
Get the font of the text with this id. |
||
set_font(id, font) |
Set the font of the text with this id. |
|
Set the font of the text with this id. |
||
get_alignment(id) | → string? |
Get the alignment of the text with this id. |
Get the alignment of the text with this id. |
||
set_alignment(id, alignment) |
Set the alignment of the text with this id. |
|
Set the alignment of the text with this id. |
||
get_vertical_alignment(id) | → string? |
Get the vertical alignment of the text with this id. |
Get the vertical alignment of the text with this id. |
||
set_vertical_alignment(id, alignment) |
Set the vertical alignment of the text with this id. |
|
Set the vertical alignment of the text with this id. |
||
get_scale_with_zoom(id) | → boolean? |
Get if the text with this id scales with player zoom. |
Get if the text with this id scales with player zoom. |
||
set_scale_with_zoom(id, scale_with_zoom) |
Set if the text with this id scales with player zoom, resulting in it always being the same size on screen, and the size compared to the game world changes. |
|
Set if the text with this id scales with player zoom, resulting in it always being the same size on screen, and the size compared to the game world changes. |
||
get_use_rich_text(id) | → boolean? |
Get if the text with this id parses rich text tags. |
Get if the text with this id parses rich text tags. |
||
set_use_rich_text(id, use_rich_text) |
Set if the text with this id parses rich text tags. |
|
Set if the text with this id parses rich text tags. |
||
get_filled(id) | → boolean? |
Get if the circle or rectangle with this id is filled. |
Get if the circle or rectangle with this id is filled. |
||
set_filled(id, filled) |
Set if the circle or rectangle with this id is filled. |
|
Set if the circle or rectangle with this id is filled. |
||
get_radius(id) | → double? |
Get the radius of the circle with this id. |
Get the radius of the circle with this id. |
||
set_radius(id, radius) |
Set the radius of the circle with this id. |
|
Set the radius of the circle with this id. |
||
get_left_top(id) | → ScriptRenderTarget? |
Get where top left corner of the rectangle with this id is drawn. |
Get where top left corner of the rectangle with this id is drawn. |
||
set_left_top(id, left_top, left_top_offset?) |
Set where top left corner of the rectangle with this id is drawn. |
|
Set where top left corner of the rectangle with this id is drawn. |
||
get_right_bottom(id) | → ScriptRenderTarget? |
Get where bottom right corner of the rectangle with this id is drawn. |
Get where bottom right corner of the rectangle with this id is drawn. |
||
set_right_bottom(id, right_bottom, right_bottom_offset?) |
Set where top bottom right of the rectangle with this id is drawn. |
|
Set where top bottom right of the rectangle with this id is drawn. |
||
set_corners(id, left_top, left_top_offset, right_bottom, right_bottom_offset) |
Set the corners of the rectangle with this id. |
|
Set the corners of the rectangle with this id. |
||
get_max_radius(id) | → double? |
Get the radius of the outer edge of the arc with this id. |
Get the radius of the outer edge of the arc with this id. |
||
set_max_radius(id, max_radius) |
Set the radius of the outer edge of the arc with this id. |
|
Set the radius of the outer edge of the arc with this id. |
||
get_min_radius(id) | → double? |
Get the radius of the inner edge of the arc with this id. |
Get the radius of the inner edge of the arc with this id. |
||
set_min_radius(id, min_radius) |
Set the radius of the inner edge of the arc with this id. |
|
Set the radius of the inner edge of the arc with this id. |
||
get_start_angle(id) | → float? |
Get where the arc with this id starts. |
Get where the arc with this id starts. |
||
set_start_angle(id, start_angle) |
Set where the arc with this id starts. |
|
Set where the arc with this id starts. |
||
get_angle(id) | → float? |
Get the angle of the arc with this id. |
Get the angle of the arc with this id. |
||
set_angle(id, angle) |
Set the angle of the arc with this id. |
|
Set the angle of the arc with this id. |
||
get_vertices(id) | → array[ScriptRenderTarget]? |
Get the vertices of the polygon with this id. |
Get the vertices of the polygon with this id. |
||
set_vertices(id, vertices) |
Set the vertices of the polygon with this id. |
|
Set the vertices of the polygon with this id. |
||
get_sprite(id) | → SpritePath? |
Get the sprite of the sprite or light with this id. |
Get the sprite of the sprite or light with this id. |
||
set_sprite(id, sprite) |
Set the sprite of the sprite or light with this id. |
|
Set the sprite of the sprite or light with this id. |
||
get_x_scale(id) | → double? |
Get the horizontal scale of the sprite or animation with this id. |
Get the horizontal scale of the sprite or animation with this id. |
||
set_x_scale(id, x_scale) |
Set the horizontal scale of the sprite or animation with this id. |
|
Set the horizontal scale of the sprite or animation with this id. |
||
get_y_scale(id) | → double? |
Get the vertical scale of the sprite or animation with this id. |
Get the vertical scale of the sprite or animation with this id. |
||
set_y_scale(id, y_scale) |
Set the vertical scale of the sprite or animation with this id. |
|
Set the vertical scale of the sprite or animation with this id. |
||
get_render_layer(id) | → RenderLayer? |
Get the render layer of the sprite or animation with this id. |
Get the render layer of the sprite or animation with this id. |
||
set_render_layer(id, render_layer) |
Set the render layer of the sprite or animation with this id. |
|
Set the render layer of the sprite or animation with this id. |
||
get_orientation_target(id) | → ScriptRenderTarget? |
The object rotates so that it faces this target. |
The object rotates so that it faces this target. |
||
set_orientation_target(id, orientation_target, orientation_target_offset?) |
The object rotates so that it faces this target. |
|
The object rotates so that it faces this target. |
||
get_oriented_offset(id) | → Vector? |
Offsets the center of the sprite or animation if |
Offsets the center of the sprite or animation if |
||
set_oriented_offset(id, oriented_offset) |
Offsets the center of the sprite or animation if |
|
Offsets the center of the sprite or animation if |
||
get_intensity(id) | → float? |
Get the intensity of the light with this id. |
Get the intensity of the light with this id. |
||
set_intensity(id, intensity) |
Set the intensity of the light with this id. |
|
Set the intensity of the light with this id. |
||
get_minimum_darkness(id) | → float? |
Get the minimum darkness at which the light with this id is rendered. |
Get the minimum darkness at which the light with this id is rendered. |
||
set_minimum_darkness(id, minimum_darkness) |
Set the minimum darkness at which the light with this id is rendered. |
|
Set the minimum darkness at which the light with this id is rendered. |
||
get_oriented(id) | → boolean? |
Get if the light with this id is rendered has the same orientation as the target entity. |
Get if the light with this id is rendered has the same orientation as the target entity. |
||
set_oriented(id, oriented) |
Set if the light with this id is rendered has the same orientation as the target entity. |
|
Set if the light with this id is rendered has the same orientation as the target entity. |
||
get_animation(id) | → string? |
Get the animation prototype name of the animation with this id. |
Get the animation prototype name of the animation with this id. |
||
set_animation(id, animation) |
Set the animation prototype name of the animation with this id. |
|
Set the animation prototype name of the animation with this id. |
||
get_animation_speed(id) | → double? |
Get the animation speed of the animation with this id. |
Get the animation speed of the animation with this id. |
||
set_animation_speed(id, animation_speed) |
Set the animation speed of the animation with this id. |
|
Set the animation speed of the animation with this id. |
||
get_animation_offset(id) | → double? |
Get the animation offset of the animation with this id. |
Get the animation offset of the animation with this id. |
||
set_animation_offset(id, animation_offset) |
Set the animation offset of the animation with this id. |
|
Set the animation offset of the animation with this id. |
||
object_name [R] | :: string |
This object's name. |
This object's name. |
Create a line.
color | :: Color |
|
width | :: float |
In pixels (32 per tile). |
In pixels (32 per tile). |
||
gap_length | :: double? |
Length of the gaps that this line has, in tiles. Default is 0. |
Length of the gaps that this line has, in tiles. Default is 0. |
||
dash_length | :: double? |
Length of the dashes that this line has. Used only if gap_length > 0. Default is 0. |
Length of the dashes that this line has. Used only if gap_length > 0. Default is 0. |
||
dash_offset | :: double? |
Starting offset to apply to dashes. Cannot be greater than dash_length + gap_length. Default is 0. |
Starting offset to apply to dashes. Cannot be greater than dash_length + gap_length. Default is 0. |
||
from | :: MapPosition or LuaEntity |
|
from_offset | :: Vector? |
Only used if |
Only used if |
||
to | :: MapPosition or LuaEntity |
|
to_offset | :: Vector? |
Only used if |
Only used if |
||
surface | :: SurfaceIdentification |
|
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
draw_on_ground | :: boolean? |
If this should be drawn below sprites and entities. |
If this should be drawn below sprites and entities. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
→ uint64 |
Id of the render object |
Draw a white and 2 pixel wide line from {0, 0} to {2, 2}.
|
Draw a red and 3 pixel wide line from {0, 0} to {0, 5}. The line has 1 tile long dashes and gaps.
|
Create a text.
text | :: LocalisedString |
The text to display. |
The text to display. |
||
surface | :: SurfaceIdentification |
|
target | :: MapPosition or LuaEntity |
|
target_offset | :: Vector? |
Only used if |
Only used if |
||
color | :: Color |
|
scale | :: double? |
|
font | :: string? |
Name of font to use. Defaults to the same font as flying-text. |
Name of font to use. Defaults to the same font as flying-text. |
||
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
draw_on_ground | :: boolean? |
If this should be drawn below sprites and entities. Rich text does not support this option. |
If this should be drawn below sprites and entities. Rich text does not support this option. |
||
orientation | :: RealOrientation? |
The orientation of the text. Default is 0. |
The orientation of the text. Default is 0. |
||
alignment | :: string? |
Defaults to "left". Other options are "right" and "center". |
Defaults to "left". Other options are "right" and "center". |
||
vertical_alignment | :: string? |
Defaults to "top". Other options are "middle", "baseline" and "bottom". |
Defaults to "top". Other options are "middle", "baseline" and "bottom". |
||
scale_with_zoom | :: boolean? |
Defaults to false. If true, the text scales with player zoom, resulting in it always being the same size on screen, and the size compared to the game world changes. |
Defaults to false. If true, the text scales with player zoom, resulting in it always being the same size on screen, and the size compared to the game world changes. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
||
use_rich_text | :: boolean? |
If rich text rendering is enabled. Defaults to false. |
If rich text rendering is enabled. Defaults to false. |
→ uint64 |
Id of the render object |
Not all fonts support scaling.
Create a circle.
color | :: Color |
|
radius | :: double |
In tiles. |
In tiles. |
||
width | :: float? |
Width of the outline, used only if filled = false. Value is in pixels (32 per tile). |
Width of the outline, used only if filled = false. Value is in pixels (32 per tile). |
||
filled | :: boolean |
If the circle should be filled. |
If the circle should be filled. |
||
target | :: MapPosition or LuaEntity |
|
target_offset | :: Vector? |
Only used if |
Only used if |
||
surface | :: SurfaceIdentification |
|
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
draw_on_ground | :: boolean? |
If this should be drawn below sprites and entities. |
If this should be drawn below sprites and entities. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
→ uint64 |
Id of the render object |
Create a rectangle.
color | :: Color |
|
width | :: float? |
Width of the outline, used only if filled = false. Value is in pixels (32 per tile). |
Width of the outline, used only if filled = false. Value is in pixels (32 per tile). |
||
filled | :: boolean |
If the rectangle should be filled. |
If the rectangle should be filled. |
||
left_top | :: MapPosition or LuaEntity |
|
left_top_offset | :: Vector? |
Only used if |
Only used if |
||
right_bottom | :: MapPosition or LuaEntity |
|
right_bottom_offset | :: Vector? |
Only used if |
Only used if |
||
surface | :: SurfaceIdentification |
|
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
draw_on_ground | :: boolean? |
If this should be drawn below sprites and entities. |
If this should be drawn below sprites and entities. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
→ uint64 |
Id of the render object |
Create an arc.
color | :: Color |
|
max_radius | :: double |
The radius of the outer edge of the arc, in tiles. |
The radius of the outer edge of the arc, in tiles. |
||
min_radius | :: double |
The radius of the inner edge of the arc, in tiles. |
The radius of the inner edge of the arc, in tiles. |
||
start_angle | :: float |
Where the arc starts, in radian. |
Where the arc starts, in radian. |
||
angle | :: float |
The angle of the arc, in radian. |
The angle of the arc, in radian. |
||
target | :: MapPosition or LuaEntity |
|
target_offset | :: Vector? |
Only used if |
Only used if |
||
surface | :: SurfaceIdentification |
|
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
draw_on_ground | :: boolean? |
If this should be drawn below sprites and entities. |
If this should be drawn below sprites and entities. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
→ uint64 |
Id of the render object |
Create a triangle mesh defined by a triangle strip.
color | :: Color |
|
vertices | :: array[ScriptRenderVertexTarget] |
|
target | :: MapPosition or LuaEntity? |
Acts like an offset applied to all vertices that are not set to an entity. |
Acts like an offset applied to all vertices that are not set to an entity. |
||
target_offset | :: Vector? |
Only used if |
Only used if |
||
orientation | :: RealOrientation? |
The orientation applied to all vertices. Default is 0. |
The orientation applied to all vertices. Default is 0. |
||
orientation_target | :: MapPosition or LuaEntity? |
If given, the vertices (that are not set to an entity) rotate so that it faces this target. Note that |
If given, the vertices (that are not set to an entity) rotate so that it faces this target. Note that |
||
orientation_target_offset | :: Vector? |
Only used if |
Only used if |
||
use_target_orientation | :: boolean? |
Only used if |
Only used if |
||
surface | :: SurfaceIdentification |
|
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
draw_on_ground | :: boolean? |
If this should be drawn below sprites and entities. |
If this should be drawn below sprites and entities. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
→ uint64 |
Id of the render object |
Create a sprite.
sprite | :: SpritePath |
|
orientation | :: RealOrientation? |
The orientation of the sprite. Default is 0. |
The orientation of the sprite. Default is 0. |
||
x_scale | :: double? |
Horizontal scale of the sprite. Default is 1. |
Horizontal scale of the sprite. Default is 1. |
||
y_scale | :: double? |
Vertical scale of the sprite. Default is 1. |
Vertical scale of the sprite. Default is 1. |
||
tint | :: Color? |
|
render_layer | :: RenderLayer? |
Render layer of the sprite. Defaults to |
Render layer of the sprite. Defaults to |
||
orientation_target | :: MapPosition or LuaEntity? |
If given, the sprite rotates so that it faces this target. Note that |
If given, the sprite rotates so that it faces this target. Note that |
||
orientation_target_offset | :: Vector? |
Only used if |
Only used if |
||
use_target_orientation | :: boolean? |
Only used if |
Only used if |
||
oriented_offset | :: Vector? |
Offsets the center of the sprite if |
Offsets the center of the sprite if |
||
target | :: MapPosition or LuaEntity |
Center of the sprite. |
Center of the sprite. |
||
target_offset | :: Vector? |
Only used if |
Only used if |
||
surface | :: SurfaceIdentification |
|
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
→ uint64 |
Id of the render object |
This will draw an iron plate icon at the character's feet. The sprite will move together with the character.
|
This will draw an iron plate icon at the character's head. The sprite will move together with the character.
|
Create a light.
sprite | :: SpritePath |
|
orientation | :: RealOrientation? |
The orientation of the light. Default is 0. |
The orientation of the light. Default is 0. |
||
scale | :: float? |
Default is 1. |
Default is 1. |
||
intensity | :: float? |
Default is 1. |
Default is 1. |
||
minimum_darkness | :: float? |
The minimum darkness at which this light is rendered. Default is 0. |
The minimum darkness at which this light is rendered. Default is 0. |
||
oriented | :: boolean? |
If this light has the same orientation as the entity target, default is false. Note that |
If this light has the same orientation as the entity target, default is false. Note that |
||
color | :: Color? |
Defaults to white (no tint). |
Defaults to white (no tint). |
||
target | :: MapPosition or LuaEntity |
Center of the light. |
Center of the light. |
||
target_offset | :: Vector? |
Only used if |
Only used if |
||
surface | :: SurfaceIdentification |
|
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
→ uint64 |
Id of the render object |
The base game uses the utility sprites light_medium
and light_small
for lights.
Create an animation.
animation | :: string |
Name of an animation prototype. |
Name of an animation prototype. |
||
orientation | :: RealOrientation? |
The orientation of the animation. Default is 0. |
The orientation of the animation. Default is 0. |
||
x_scale | :: double? |
Horizontal scale of the animation. Default is 1. |
Horizontal scale of the animation. Default is 1. |
||
y_scale | :: double? |
Vertical scale of the animation. Default is 1. |
Vertical scale of the animation. Default is 1. |
||
tint | :: Color? |
|
render_layer | :: RenderLayer? |
Render layer of the animation. Defaults to |
Render layer of the animation. Defaults to |
||
animation_speed | :: double? |
How many frames the animation goes forward per tick. Default is 1. |
How many frames the animation goes forward per tick. Default is 1. |
||
animation_offset | :: double? |
Offset of the animation in frames. Default is 0. |
Offset of the animation in frames. Default is 0. |
||
orientation_target | :: MapPosition or LuaEntity? |
If given, the animation rotates so that it faces this target. Note that |
If given, the animation rotates so that it faces this target. Note that |
||
orientation_target_offset | :: Vector? |
Only used if |
Only used if |
||
use_target_orientation | :: boolean? |
Only used if |
Only used if |
||
oriented_offset | :: Vector? |
Offsets the center of the animation if |
Offsets the center of the animation if |
||
target | :: MapPosition or LuaEntity |
Center of the animation. |
Center of the animation. |
||
target_offset | :: Vector? |
Only used if |
Only used if |
||
surface | :: SurfaceIdentification |
|
time_to_live | :: uint? |
In ticks. Defaults to living forever. |
In ticks. Defaults to living forever. |
||
forces | :: array[ForceIdentification]? |
The forces that this object is rendered to. Passing |
The forces that this object is rendered to. Passing |
||
players | :: array[PlayerIdentification]? |
The players that this object is rendered to. Passing |
The players that this object is rendered to. Passing |
||
visible | :: boolean? |
If this is rendered to anyone at all. Defaults to true. |
If this is rendered to anyone at all. Defaults to true. |
||
only_in_alt_mode | :: boolean? |
If this should only be rendered in alt mode. Defaults to false. |
If this should only be rendered in alt mode. Defaults to false. |
→ uint64 |
Id of the render object |
Gets an array of all valid object ids.
mod_name | :: string? |
If provided, get only the render objects created by this mod. An empty string ( |
If provided, get only the render objects created by this mod. An empty string ( |
Destroys all render objects. Passing an empty string (""
)
mod_name | :: string? |
If provided, only the render objects created by this mod are destroyed. An empty string ( |
If provided, only the render objects created by this mod are destroyed. An empty string ( |
Gets the type of the given object. The types are "text", "line", "circle", "rectangle", "arc", "polygon", "sprite", "light" and "animation".
id | :: uint64 |
|
Reorder this object so that it is drawn in front of the already existing objects.
id | :: uint64 |
|
Get the time to live of the object with this id. This will be 0 if the object does not expire.
id | :: uint64 |
|
Get the forces that the object with this id is rendered to or nil
if visible to all forces.
id | :: uint64 |
|
Set the forces that the object with this id is rendered to.
id | :: uint64 |
|
forces | :: array[ForceIdentification] |
Providing an empty array will set the object to be visible to all forces. |
Providing an empty array will set the object to be visible to all forces. |
Get the players that the object with this id is rendered to or nil
if visible to all players.
id | :: uint64 |
|
Set the players that the object with this id is rendered to.
id | :: uint64 |
|
players | :: array[PlayerIdentification] |
Providing an empty array will set the object to be visible to all players. |
Providing an empty array will set the object to be visible to all players. |
Get whether this is being drawn on the ground, under most entities and sprites.
id | :: uint64 |
|
Get from where the line with this id is drawn.
id | :: uint64 |
|
→ ScriptRenderTarget? |
|
Set from where the line with this id is drawn. Does nothing if the object is not a line.
id | :: uint64 |
|
from | :: MapPosition or LuaEntity |
|
from_offset | :: Vector? |
|
Get where the line with this id is drawn to.
id | :: uint64 |
|
→ ScriptRenderTarget? |
|
Set where the line with this id is drawn to. Does nothing if this object is not a line.
id | :: uint64 |
|
to | :: MapPosition or LuaEntity |
|
to_offset | :: Vector? |
|
Get where the object with this id is drawn.
id | :: uint64 |
|
→ ScriptRenderTarget? |
|
Polygon vertices that are set to an entity will ignore this.
Set where the object with this id is drawn. Does nothing if this object does not support target.
id | :: uint64 |
|
target | :: MapPosition or LuaEntity |
|
target_offset | :: Vector? |
|
Polygon vertices that are set to an entity will ignore this.
Get the orientation of the object with this id.
id | :: uint64 |
|
→ RealOrientation? |
|
Polygon vertices that are set to an entity will ignore this.
Set the orientation of the object with this id. Does nothing if this object is not a text, polygon, sprite, light or animation.
id | :: uint64 |
|
orientation | :: RealOrientation |
|
Polygon vertices that are set to an entity will ignore this.
Get the text that is displayed by the text with this id.
id | :: uint64 |
|
→ LocalisedString? |
|
Set the text that is displayed by the text with this id. Does nothing if this object is not a text.
id | :: uint64 |
|
text | :: LocalisedString |
|
Get where top left corner of the rectangle with this id is drawn.
id | :: uint64 |
|
→ ScriptRenderTarget? |
|
Set where top left corner of the rectangle with this id is drawn. Does nothing if this object is not a rectangle.
id | :: uint64 |
|
left_top | :: MapPosition or LuaEntity |
|
left_top_offset | :: Vector? |
|
Get where bottom right corner of the rectangle with this id is drawn.
id | :: uint64 |
|
→ ScriptRenderTarget? |
|
Set where top bottom right of the rectangle with this id is drawn. Does nothing if this object is not a rectangle.
id | :: uint64 |
|
right_bottom | :: MapPosition or LuaEntity |
|
right_bottom_offset | :: Vector? |
|
Set the corners of the rectangle with this id. Does nothing if this object is not a rectangle.
id | :: uint64 |
|
left_top | :: MapPosition or LuaEntity |
|
left_top_offset | :: Vector |
|
right_bottom | :: MapPosition or LuaEntity |
|
right_bottom_offset | :: Vector |
|
Get the vertices of the polygon with this id.
id | :: uint64 |
|
→ array[ScriptRenderTarget]? |
|
Set the vertices of the polygon with this id. Does nothing if this object is not a polygon.
id | :: uint64 |
|
vertices | :: array[ScriptRenderVertexTarget] |
|
Get the sprite of the sprite or light with this id.
id | :: uint64 |
|
→ SpritePath? |
|
Set the sprite of the sprite or light with this id. Does nothing if this object is not a sprite or light.
id | :: uint64 |
|
sprite | :: SpritePath |
|
Get the render layer of the sprite or animation with this id.
id | :: uint64 |
|
→ RenderLayer? |
|
Set the render layer of the sprite or animation with this id. Does nothing if this object is not a sprite or animation.
id | :: uint64 |
|
render_layer | :: RenderLayer |
|
The object rotates so that it faces this target. Note that orientation
is still applied to the object. Get the orientation_target of the object with this id.
id | :: uint64 |
|
→ ScriptRenderTarget? |
|
Polygon vertices that are set to an entity will ignore this.
The object rotates so that it faces this target. Note that orientation
is still applied to the object. Set the orientation_target of the object with this id. Does nothing if this object is not a polygon, sprite, or animation. Set to nil
if the object should not have an orientation_target.
id | :: uint64 |
|
orientation_target | :: MapPosition or LuaEntity |
|
orientation_target_offset | :: Vector? |
|
Polygon vertices that are set to an entity will ignore this.
Offsets the center of the sprite or animation if orientation_target
is given. This offset will rotate together with the sprite or animation. Get the oriented_offset of the sprite or animation with this id.
id | :: uint64 |
|
→ Vector? |
|
Offsets the center of the sprite or animation if orientation_target
is given. This offset will rotate together with the sprite or animation. Set the oriented_offset of the sprite or animation with this id. Does nothing if this object is not a sprite or animation.
id | :: uint64 |
|
oriented_offset | :: Vector |
|
This object's name.