Skip to main content

Renderer

Renderer namespace with useful drawing functions intended for debugging and development.

tip

For optimal performance and better visual quality, please prefer using functions described in Renderer section.

caution

Please do not overuse these in your final production. The functions described on this page are intended for debugging and development purposes.

Functions

RGBA

Renderer.RGBA( r: number, g: number, b: number, a: number ) number

ArgumentTypeDescription
rnumberRed 0-255
gnumberGreen 0-255
bnumberBlue 0-255
anumberAlpha 0-255

Get proper color value


DrawCircle3D

Renderer.DrawCircle3D(
position: Vector2,
radius: number - integer,
sides: number - integer,
width: number - integer,
color: number - D3DCOLOR
) void

ArgumentTypeDescription
positionVector2Center position.
radiusnumber - integerRadius
sidesnumber - integerSides
widthnumber - integerLine width
colornumber - D3DCOLORColor

Draw basic circle in game world.


DrawCircle3D

Renderer.DrawCircle3D(
position: Vector3,
radius: number - integer,
sides: number - integer,
width: number - integer,
color: number - D3DCOLOR
) void

ArgumentTypeDescription
positionVector3Center position.
radiusnumber - integerRadius
sidesnumber - integerSides
widthnumber - integerLine width
colornumber - D3DCOLORColor

Draw basic circle in game world.


DrawVectorPoly

Renderer.DrawVectorPoly(
vectorPoly: Vector2[],
width: number - float,
color: number - D3DCOLOR
) void

ArgumentTypeDescription
vectorPolyVector2[]Points which make a path.
widthnumber - floatLine width.
colornumber - D3DCOLORLine color.

Draw vector poly path.


DrawVectorPoly

Renderer.DrawVectorPoly(
vectorPoly: Vector3[] - std::vector<Vector3>,
width: number - float,
color: number - D3DCOLOR
) void

ArgumentTypeDescription
vectorPolyVector3[] - std::vector<Vector3>Points which make a path.
widthnumber - floatLine width.
colornumber - D3DCOLORLine color.

Draw vector poly path.


DrawCross

Renderer.DrawCross(
position: Vector2,
size?: number - float,
color?: number - D3DCOLOR
) void

ArgumentTypeDescription
positionVector2World position.
size?number - floatCross size. 100 by default.
color?number - D3DCOLORLine color. White by default.

Draw cross in game world.

tip

Useful to see exact position of any unit in game.


DrawPath

Renderer.DrawPath(
path: Path64,
width: number - float,
color: number - D3DCOLOR
) void

ArgumentTypeDescription
pathPath64
widthnumber - floatLine width.
colornumber - D3DCOLORLine color.

Draw Clipper Path64 polygon.


DrawPaths

Renderer.DrawPaths(
paths: Paths64,
width: number - float,
color: number - D3DCOLOR
) void

ArgumentTypeDescription
pathsPaths64
widthnumber - floatLine width.
colornumber - D3DCOLORLine color.

Draw Clipper Paths64 polygons.

Example: Full DrawPaths example with Clipper.Union and Clipper.PointInPolygons
Callback.Bind(CallbackType.OnDraw, function()
local pos = Game.localPlayer.position2D

local path1 = Clipper.CreatePath64FromVectors({
Math.Vector2(pos.x - 300, pos.y - 300),
Math.Vector2(pos.x + 300, pos.y - 300),
Math.Vector2(pos.x + 300, pos.y + 300),
Math.Vector2(pos.x - 300, pos.y + 300),
})

local path2 = Clipper.CreatePath64FromVectors({
Math.Vector2(pos.x - 200 + 300, pos.y - 200),
Math.Vector2(pos.x + 200 + 300, pos.y - 200),
Math.Vector2(pos.x + 200 + 300, pos.y + 200),
Math.Vector2(pos.x - 200 + 300, pos.y + 200),
})

local union = Clipper.Union(Clipper.CreatePaths64({path1}), Clipper.CreatePaths64({path2}), Clipper.FillRule.NonZero)

Renderer.DrawPaths(union, 1, Clipper.PointInPolygons(Game.GetCursorWorldPosition(), union) and 0xFF00FF00 or 0xFFFF0000)
end)