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 Battle |
-
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 93
-
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 116
-
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 138
-
debug_drawing:draw_circle_on_terrain(
position
battle_vector
,
radius
number
,
duration
number
,
colour
battle_colour
) -
Draws a circle on the terrain of 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 157
-
debug_drawing:draw_line_on_terrain(
position
battle_vector
,
position
battle_vector
,
duration
number
,
colour
battle_colour
) -
Draws a line on the terrain of 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 182
-
debug_drawing:draw_peg_on_terrain(
positionbattle_vector
,
durationnumber
,
colourbattle_colour
)
-
Draws a vertical line on the terrain of 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 204
-
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 226
-
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 250
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 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 477