Renderer
Renderer namespace with useful drawing functions intended for debugging and development.
For optimal performance and better visual quality, please prefer using functions described in Renderer section.
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
Argument | Type | Description |
---|---|---|
r | number | Red 0-255 |
g | number | Green 0-255 |
b | number | Blue 0-255 |
a | number | Alpha 0-255 |
Get proper color value
DrawCircle3D
Renderer.DrawCircle3D(
position
: Vector2,
radius
: number - integer,
sides
: number - integer,
width
: number - integer,
color
: number - D3DCOLOR
)
→ void
Argument | Type | Description |
---|---|---|
position | Vector2 | Center position. |
radius | number - integer | Radius |
sides | number - integer | Sides |
width | number - integer | Line width |
color | number - D3DCOLOR | Color |
Draw basic circle in game world.
DrawCircle3D
Renderer.DrawCircle3D(
position
: Vector3,
radius
: number - integer,
sides
: number - integer,
width
: number - integer,
color
: number - D3DCOLOR
)
→ void
Argument | Type | Description |
---|---|---|
position | Vector3 | Center position. |
radius | number - integer | Radius |
sides | number - integer | Sides |
width | number - integer | Line width |
color | number - D3DCOLOR | Color |
Draw basic circle in game world.
DrawVectorPoly
Renderer.DrawVectorPoly(
vectorPoly
: Vector2[],
width
: number - float,
color
: number - D3DCOLOR
)
→ void
Argument | Type | Description |
---|---|---|
vectorPoly | Vector2[] | Points which make a path. |
width | number - float | Line width. |
color | number - D3DCOLOR | Line color. |
Draw vector poly path.
DrawVectorPoly
Renderer.DrawVectorPoly(
vectorPoly
: Vector3[] - std::vector<Vector3>,
width
: number - float,
color
: number - D3DCOLOR
)
→ void
Argument | Type | Description |
---|---|---|
vectorPoly | Vector3[] - std::vector<Vector3> | Points which make a path. |
width | number - float | Line width. |
color | number - D3DCOLOR | Line color. |
Draw vector poly path.
DrawCross
Renderer.DrawCross(
position
: Vector2,
size?
: number - float,
color?
: number - D3DCOLOR
)
→ void
Argument | Type | Description |
---|---|---|
position | Vector2 | World position. |
size? | number - float | Cross size. 100 by default. |
color? | number - D3DCOLOR | Line color. White by default. |
Draw cross in game world.
Useful to see exact position of any unit in game.
DrawPath
Renderer.DrawPath(
path
: Path64,
width
: number - float,
color
: number - D3DCOLOR
)
→ void
Argument | Type | Description |
---|---|---|
path | Path64 | |
width | number - float | Line width. |
color | number - D3DCOLOR | Line color. |
Draw Clipper Path64
polygon.
DrawPaths
Renderer.DrawPaths(
paths
: Paths64,
width
: number - float,
color
: number - D3DCOLOR
)
→ void
Argument | Type | Description |
---|---|---|
paths | Paths64 | |
width | number - float | Line width. |
color | number - D3DCOLOR | Line color. |
Draw Clipper Paths64
polygons.
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)