Debug Drawing
The debug_drawing
interface allows the drawing of debug lines on the battlefield by script. A debug_drawing
object may be retrieved from the battle
object with battle:debug_drawing
.
Note that debug lines must be enabled for these lines to display.
Loaded in Campaign | |
Loaded in Battle | |
Loaded in Frontend |
-
debug_drawing:draw_white_circle_on_terrain(
positionbattle_vector
,
radiusnumber
,
durationnumber
)
-
Draws a white circle on the terrain.
Parameters:
1
Centre position.
2
Radius of circle in m.
3
Duration for which to display the circle, in seconds.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 94
-
debug_drawing:draw_white_line_on_terrain(
positionbattle_vector
,
positionbattle_vector
,
durationnumber
)
-
Draws a white line on the terrain.
Parameters:
1
Start position.
2
End position.
3
Duration for which to display the line, in seconds.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 117
-
debug_drawing:draw_white_peg_on_terrain(
positionbattle_vector
,
durationnumber
)
-
Draws a vertical white line on the terrain.
Parameters:
1
Position.
2
Duration for which to display the peg, in seconds.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 139
-
debug_drawing:draw_circle_on_terrain(
position
battle_vector
,
radius
number
,
duration
number
,
colour
battle_colour
) -
Draws a circle on the terrain in a supplied colour.
Parameters:
1
Centre position.
2
Radius of circle in m.
3
Duration for which to display the circle, in seconds.
4
Line colour.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 158
-
debug_drawing:draw_line_on_terrain(
position
battle_vector
,
position
battle_vector
,
duration
number
,
colour
battle_colour
) -
Draws a line on the terrain in a supplied colour.
Parameters:
1
Start position.
2
End position.
3
Duration for which to display the line, in seconds.
4
Line colour.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 183
-
debug_drawing:draw_peg_on_terrain(
positionbattle_vector
,
durationnumber
,
colourbattle_colour
)
-
Draws a vertical line on the terrain in a supplied colour.
Parameters:
1
Position.
2
Duration for which to display the peg, in seconds.
3
Line colour.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 205
-
debug_drawing:draw_obb_on_terrain(
position
battle_vector
,
width
number
,
height
number
,
orientation
number
,
duration
number
,
colour
battle_colour
) -
Draws a debug rectangle shape on the terrain in a supplied colour.
Parameters:
1
Position.
2
Width in metres.
3
Height in metres.
4
Orientation in radians.
5
Duration for which to display the shape, in seconds.
6
Line colour.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 226
-
debug_drawing:draw_2d_text(
textstring
,
durationnumber
,
xnumber
,
ynumber
)
-
Draws some 2D debug text.
Parameters:
1
Text to display.
2
Duration for which to display the text, in seconds.
3
x position.
4
y position.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 257
-
debug_drawing:draw_3d_text(
textstring
,
durationnumber
,
xnumber
,
ynumber
,
znumber
)
-
Draws some 3D debug text.
Parameters:
1
Text to display.
2
Duration for which to display the text, in seconds.
3
x position.
4
y position.
5
z position.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 281
Colour
A colour object can be set up to represent a certain rgb colour. Once set up, a colour object can be passed to certain functions on the battle_debug_drawing
interface to draw debug lines of that colour.
-
battle_colour:new(
rednumber
,
greennumber
,
bluenumber
)
-
Creates and returns a new
battle_colour
object.Parameters:
1
Red colour value (0 - 255).
2
Green colour value (0 - 255).
3
Blue colour value (0 - 255).
Returns:
defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptUtilities.cpp, line 505