draw
Functions for drawing primitives. Usually won't work outside the `Paint` event
Enumerations
ECornerRenderFlags
Description: rounding corners render flags for all function with roundingCorners
argument, requires flRounding
greater than 0.0
⚠️ Warning: ALL
cannot be used with other flags
Indentifiers |
NONE |
TOP_LEFT |
TOP_RIGHT |
BOTTOM_LEFT |
BOTTOM_RIGHT |
ALL |
ERectRenderFlags
Description: render flags for AddRect()
Indentifiers |
DRAW_RECT_NONE |
DRAW_RECT_OUTLINE |
DRAW_RECT_BORDER |
DRAW_RECT_FILLED |
EBox3DRenderFlags
Description: render flags for AddBox3D()
Indentifiers |
DRAW_BOX3D_NONE |
DRAW_BOX3D_OUTLINE |
DRAW_BOX3D_FILLED |
ECircleRenderFlags
Description: render flags for AddCircle()
Indentifiers |
DRAW_CIRCLE_NONE |
DRAW_CIRCLE_OUTLINE |
DRAW_CIRCLE_FILLED |
ECircle3DRenderFlags
Description: render flags for AddCircle3D()
Indentifiers |
DRAW_CIRCLE3D_NONE |
DRAW_CIRCLE3D_OUTLINE |
DRAW_CIRCLE3D_FILLED |
DRAW_CIRCLE3D_DOTTED |
ETriangleRenderFlags
Description: render flags for AddTriangle()
Indentifiers |
DRAW_TRIANGLE_NONE |
DRAW_TRIANGLE_OUTLINE |
DRAW_TRIANGLE_FILLED |
EQuadRenderFlags
Description: render flags for AddQuad()
Indentifiers |
DRAW_QUAD_NONE |
DRAW_QUAD_OUTLINE |
DRAW_QUAD_FILLED |
EPolygonRenderFlags
Description: render flags for AddPolygon()
Indentifiers |
DRAW_POLYGON_NONE |
DRAW_POLYGON_OUTLINE |
DRAW_POLYGON_FILLED |
ETextRenderFlags
Description: render flags for AddText()
⚠️ Warning: DRAW_TEXT_DROPSHADOW
and DRAW_TEXT_OUTLINE
flags cannot be used together
Indentifiers |
DRAW_TEXT_NONE |
DRAW_TEXT_DROPSHADOW |
DRAW_TEXT_OUTLINE |
ERasterizerFlags
Description: rasterizer flags for AddFont()
Indentifiers |
NO_HINTING |
NO_AUTOHINT |
FORCE_AUTOHINT |
LIGHT_HINTING |
MONO_HINTING |
BOLD |
OBLIQUE |
MONOCHROME |
Functions
WorldToScreen
Parameters:
Name | Type | Description |
vecWorldOrigin | position in world space |
Returns:
Type | Description |
position of given world space in screen space |
Code:
AddLine
Parameters:
Name | Type | Description |
vecStart | start position of line | |
vecEnd | end position of line | |
colLine | color of line | |
flThickness | float | thickness of line |
Code:
AddRect
Parameters:
Name | Type | Description |
vecMin | minimal position of rect | |
vecMax | maximal position of rect | |
colRect | color of rect | |
render flags | ||
colOutline | color of outline | |
flRounding | float | corners rounding value |
rounding corners render flags | ||
flThickness | float | thickness of non-filled rect / outline of filled rect |
Code:
AddRectMultiColor
Parameters:
Name | Type | Description |
vecMin | minimal position of rect | |
vecMax | maximal position of rect | |
colUpperLeft | color of upper-left corner of rect | |
colUpperRight | color of upper-right corner of rect | |
colBottomRight | color of bottom-right corner of rect | |
colBottomLeft | color of bottom-left corner of rect |
Code:
AddBox3D
Parameters:
Name | Type | Description |
vecCenter | center position of 3D box in world space | |
vecAbsMin | absolute minimal 3D box expansion | |
vecAbsMax | absolute maximal 3D box expansion | |
angOrientation | angle of 3D box rotation | |
colBox | color of 3D box | |
render flags | ||
colOutline | color of outline | |
flThickness | float | thickness of non-filled 3D box / outline of filled 3D box |
Code:
AddCircle
Parameters:
Name | Type | Description |
vecCenter | center position of circle | |
flRadius | float | radius of circle |
colCircle | color of circle | |
nSegments | int | segments count for circle |
render flags | ||
colOutline | color of outline | |
flThickness | float | thickness of non-filled circle / outline of filled circle |
Code:
AddCircle3D
Parameters:
Name | Type | Description |
vecCenter | center position of 3D circle in world space | |
flRadius | float | radius of 3D circle |
colCircle | color of 3D circle | |
nSegments | int | segments count for 3D circle |
render flags | ||
colOutline | color of outline | |
flThickness | float | thickness of non-filled 3D circle / outline of filled 3D circle |
Code:
AddTriangle
Parameters:
Name | Type | Description |
vecFirst | first position of triangle | |
vecSecond | second position of triangle | |
vecThird | third position of triangle | |
colTriangle | color of triangle | |
render flags | ||
colOutline | color of outline | |
flThickness | float | thickness of non-filled triangle / outline of filled triangle |
Code:
AddQuad
Parameters:
Name | Type | Description |
vecFirst | first position of quad | |
vecSecond | second position of quad | |
vecThird | third position of quad | |
vecFourth | fourth position of quad | |
colQuad | color of quad | |
render flags | ||
colOutline | color of outline | |
flThickness | float | thickness of non-filled quad / outline of filled quad |
Code:
AddArc
Parameters:
Name | Type | Description |
vecCenter | center position of arc | |
flRadius | float | radius of arc |
vecAngleRange | minimal and maximal angles of arc | |
colArc | color of arc | |
flThickness | float | thickness of arc |
Code:
AddPolygon
Parameters:
Name | Type | Description |
vecPoints | table | polygon positions |
colPolygon | color of polygon | |
render flags | ||
colOutline | color of outline | |
bClosed | bool | if true after last point will be automatically added first point |
flThickness | float | thickness of non-filled polygon / outline of filled polygon |
Code:
AddFont
Parameters:
Name | Type | Description |
vecPoints | string | path to font file (.ttf / .otf) |
flFontSize | float | size of font in pixels |
rasterizer flags |
Returns:
Type | Description |
uint32 | hash of added font |
Code:
RemoveFont
Parameters:
Name | Type | Description |
uFontHash | uint32 | hash of font that will be removed |
Code:
GetTextSize
Parameters:
Name | Type | Description |
uFontHash | uint32 | hash of font for will be calculated size |
flFontSize | float | size of font in pixels |
szText | string | text for will be calculated size |
Returns:
Type | Description |
size for given font with given text |
Code:
AddText
Parameters:
Name | Type | Description |
uFontHash | uint32 | hash of font text will be rendered with |
flFontSize | float | size of font in pixels |
vecPosition | left-top corner position of text | |
szText | string | text to render by given font hash |
colText | color of text | |
render flags | ||
colOutline | color of outline | |
flThickness | float | thickness of outlined text |
Code:
Last updated