natiny_render_text_ex
void natiny_render_text_ex(NatinyFont font, float x, float y,
const char* text, float origin_x,
float origin_y, float rotation);
Draws an unwrapped UTF-8 text block with a local origin and rotation.
Parameters
| Name | Type | Description |
|---|---|---|
font |
NatinyFont |
Font handle from natiny_font_create |
x, y |
float |
Position of the local origin on the current target, in drawing units |
text |
const char* |
Null-terminated UTF-8 text to draw |
origin_x |
float |
Horizontal origin offset from the block's left edge, in drawing units |
origin_y |
float |
Vertical origin offset from the block's top edge, in drawing units |
rotation |
float |
Clockwise rotation around (x, y), in degrees |
Example
float width = 0.0f, height = 0.0f;
natiny_font_measure_text(font, "SPIN", &width, &height);
natiny_render_text_ex(font, 400.0f, 300.0f, "SPIN",
width * 0.5f, height * 0.5f, angle);