Add DrawTextEx convenience function
This commit is contained in:
parent
ffd84715d7
commit
b5df9b480d
1 changed files with 24 additions and 13 deletions
|
@ -36,6 +36,17 @@ pub fn DrawAndMeasureText(
|
||||||
.height = 10,
|
.height = 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
pub fn DrawTextEx(
|
||||||
|
font: rl.Font,
|
||||||
|
text: [*c]const u8,
|
||||||
|
pos_x: f32,
|
||||||
|
pos_y: f32,
|
||||||
|
font_size: f32,
|
||||||
|
spacing: f32,
|
||||||
|
color: rl.Color,
|
||||||
|
) void {
|
||||||
|
rl.DrawTextEx(font, text, rl.Vector2{ .x = pos_x, .y = pos_y }, font_size, spacing, color);
|
||||||
|
}
|
||||||
pub fn DrawAndMeasureTextEx(
|
pub fn DrawAndMeasureTextEx(
|
||||||
font: rl.Font,
|
font: rl.Font,
|
||||||
text: [*c]const u8,
|
text: [*c]const u8,
|
||||||
|
@ -45,7 +56,7 @@ pub fn DrawAndMeasureTextEx(
|
||||||
spacing: f32,
|
spacing: f32,
|
||||||
color: rl.Color,
|
color: rl.Color,
|
||||||
) rl.Vector2 {
|
) rl.Vector2 {
|
||||||
rl.DrawTextEx(font, text, rl.Vector2 { .x = pos_x, .y = pos_y }, font_size, spacing, color);
|
rl.DrawTextEx(font, text, rl.Vector2{ .x = pos_x, .y = pos_y }, font_size, spacing, color);
|
||||||
return rl.MeasureTextEx(font, text, font_size, spacing);
|
return rl.MeasureTextEx(font, text, font_size, spacing);
|
||||||
}
|
}
|
||||||
pub fn DrawRightAlignedText(
|
pub fn DrawRightAlignedText(
|
||||||
|
|
Loading…
Add table
Reference in a new issue