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 Campaign
Loaded in Battle Loaded in Battle
Loaded in Frontend Loaded in Frontend
Back to top

Functionality

debug_drawing:draw_white_circle_on_terrain(battle_vector position, number radius, number duration)

Draws a white circle on the terrain.

Parameters:

1

battle_vector

Centre position.

2

number

Radius of circle in m.

3

number

Duration for which to display the circle, in seconds.

Returns:

  1. nil

debug_drawing:draw_white_line_on_terrain(battle_vector position, battle_vector position, number duration)

Draws a white line on the terrain.

Parameters:

1

battle_vector

Start position.

2

battle_vector

End position.

3

number

Duration for which to display the line, in seconds.

Returns:

  1. nil

debug_drawing:draw_white_peg_on_terrain(battle_vector position, number duration)

Draws a vertical white line on the terrain.

Parameters:

1

battle_vector

Position.

2

number

Duration for which to display the peg, in seconds.

Returns:

  1. nil

debug_drawing:draw_circle_on_terrain(
  
battle_vector position,
  number
radius,
  number
duration,
  battle_colour
colour
)

Draws a circle on the terrain in a supplied colour.

Parameters:

1

battle_vector

Centre position.

2

number

Radius of circle in m.

3

number

Duration for which to display the circle, in seconds.

4

battle_colour

Line colour.

Returns:

  1. nil

debug_drawing:draw_line_on_terrain(
  
battle_vector position,
  battle_vector
position,
  number
duration,
  battle_colour
colour
)

Draws a line on the terrain in a supplied colour.

Parameters:

1

battle_vector

Start position.

2

battle_vector

End position.

3

number

Duration for which to display the line, in seconds.

4

battle_colour

Line colour.

Returns:

  1. nil

debug_drawing:draw_peg_on_terrain(battle_vector position, number duration, battle_colour colour)

Draws a vertical line on the terrain in a supplied colour.

Parameters:

1

battle_vector

Position.

2

number

Duration for which to display the peg, in seconds.

3

battle_colour

Line colour.

Returns:

  1. nil

debug_drawing:draw_obb_on_terrain(
  
battle_vector position,
  number
width,
  number
height,
  number
orientation,
  number
duration,
  battle_colour
colour
)

Draws a debug rectangle shape on the terrain in a supplied colour.

Parameters:

1

battle_vector

Position.

2

number

Width in metres.

3

number

Height in metres.

4

number

Orientation in radians.

5

number

Duration for which to display the shape, in seconds.

6

battle_colour

Line colour.

Returns:

  1. nil

debug_drawing:draw_2d_text(string text, number duration, number x, number y)

Draws some 2D debug text.

Parameters:

1

string

Text to display.

2

number

Duration for which to display the text, in seconds.

3

number

x position.

4

number

y position.

Returns:

  1. nil

debug_drawing:draw_3d_text(string text, number duration, number x, number y, number z)

Draws some 3D debug text.

Parameters:

1

string

Text to display.

2

number

Duration for which to display the text, in seconds.

3

number

x position.

4

number

y position.

5

number

z position.

Returns:

  1. nil

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.

Back to top

Creation

battle_colour:new(number red, number green, number blue)

Creates and returns a new battle_colour object.

Parameters:

1

number

Red colour value (0 - 255).

2

number

Green colour value (0 - 255).

3

number

Blue colour value (0 - 255).

Returns:

  1. battle_colour
Last updated 7/9/2024 11:45:05 AM