Draw#
Defined in Draw.hpp. All drawing functions are in the xenon::Draw namespace. Call these from on_render().
Line#
void Draw::Line(float x1, float y1, float x2, float y2, Color color, float thickness = 1.f);
void Draw::Line(const Vector2& start, const Vector2& end, Color color, float thickness = 1.f);
Draws a line between two points.
| Parameter | Type | Description |
|---|---|---|
x1, y1 |
float |
Start point |
x2, y2 |
float |
End point |
color |
Color |
Line color |
thickness |
float |
Line width in pixels (default: 1) |
Draw::Line(100, 100, 200, 200, Color::Red());
Draw::Line(screenCenter, targetPos, Color::White(), 2.f);
Circle#
void Draw::Circle(float x, float y, float radius, Color color, float thickness = 1.f);
void Draw::Circle(const Vector2& center, float radius, Color color, float thickness = 1.f);
Draws a circle outline.
| Parameter | Type | Description |
|---|---|---|
x, y |
float |
Center position |
radius |
float |
Radius in pixels |
color |
Color |
Circle color |
thickness |
float |
Line width (default: 1) |
CircleFilled#
void Draw::CircleFilled(float x, float y, float radius, Color color);
void Draw::CircleFilled(const Vector2& center, float radius, Color color);
Draws a filled circle.
| Parameter | Type | Description |
|---|---|---|
x, y |
float |
Center position |
radius |
float |
Radius in pixels |
color |
Color |
Fill color |
Rect#
void Draw::Rect(float x, float y, float w, float h, Color color, float thickness = 1.f);
void Draw::Rect(const Vector2& pos, const Vector2& size, Color color, float thickness = 1.f);
Draws a rectangle outline.
| Parameter | Type | Description |
|---|---|---|
x, y |
float |
Top-left corner |
w, h |
float |
Width and height |
color |
Color |
Border color |
thickness |
float |
Line width (default: 1) |
RectFilled#
void Draw::RectFilled(float x, float y, float w, float h, Color color);
void Draw::RectFilled(const Vector2& pos, const Vector2& size, Color color);
Draws a filled rectangle.
| Parameter | Type | Description |
|---|---|---|
x, y |
float |
Top-left corner |
w, h |
float |
Width and height |
color |
Color |
Fill color |
Text#
void Draw::Text(float x, float y, Color color, const char* text, int size = 0);
void Draw::Text(const Vector2& pos, Color color, const char* text, int size = 0);
Draws text at the specified position.
| Parameter | Type | Description |
|---|---|---|
x, y |
float |
Top-left position |
color |
Color |
Text color |
text |
const char* |
The text string |
size |
int |
Font size (0 = default) |
Draw::Text(100, 700, Color::White(), "Hello World");
Draw::Text(headScreen, Color::Yellow(), "Enemy", 16);
HealthBar#
void Draw::HealthBar(float x, float y, float width, float height, float healthPercent,
Color bgColor = Color(50, 50, 50),
Color healthColor = Color::Green(),
Color borderColor = Color::White());
Draws a health bar with automatic color gradient (green at full, red at empty).
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y |
float |
— | Top-left position |
width |
float |
— | Bar width |
height |
float |
— | Bar height |
healthPercent |
float |
— | Health percentage (0-100) |
bgColor |
Color |
(50, 50, 50) |
Background color |
healthColor |
Color |
Green |
(Unused — color is auto-computed from percentage) |
borderColor |
Color |
White |
Border color |
float hp = enemy.GetHealthPercent();
Draw::HealthBar(headScreen.x - 25, headScreen.y + 10, 50, 4, hp);
Unused parameter
The healthColor parameter is accepted for API compatibility but currently ignored. The fill color is automatically computed from healthPercent: green at 100%, yellow at 50%, red at 0%. You can safely omit it:
TextShadow#
void Draw::TextShadow(float x, float y, Color color, const char* text, int size = 0, Color shadowColor = Color::Black());
void Draw::TextShadow(const Vector2& pos, Color color, const char* text, int size = 0, Color shadowColor = Color::Black());
Draws text with a 1-pixel offset shadow for readability. The shadow inherits the text's alpha.
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y |
float |
— | Text position |
color |
Color |
— | Text color |
text |
const char* |
— | Text string |
size |
int |
0 |
Font size (0 = default) |
shadowColor |
Color |
Black |
Shadow color (alpha is overridden by text's alpha) |
TextCentered#
void Draw::TextCentered(float x, float y, Color color, const char* text, int size = 0, Color shadowColor = Color::Black());
void Draw::TextCentered(const Vector2& pos, Color color, const char* text, int size = 0, Color shadowColor = Color::Black());
Draws roughly centered text with a shadow. Centers by offsetting strlen(text) * 3 pixels to the left.
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y |
float |
— | Center position |
color |
Color |
— | Text color |
text |
const char* |
— | Text string |
size |
int |
0 |
Font size (0 = default) |
shadowColor |
Color |
Black |
Shadow color |
Note
Centering is approximate since the default font is not monospaced at all sizes. Works well for the default font size.
RectCorners#
void Draw::RectCorners(float x, float y, float w, float h, Color color, float thickness = 1.5f);
void Draw::RectCorners(const Vector2& pos, const Vector2& size, Color color, float thickness = 1.5f);
Draws corner bracket marks (25% of each edge) instead of a full rectangle. Common for tactical/military-style ESP bounding boxes.
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y |
float |
— | Top-left corner |
w, h |
float |
— | Width and height |
color |
Color |
— | Line color |
thickness |
float |
1.5 |
Line thickness |