- afegida carpeta release
- jitter en renderInfo
This commit is contained in:
@@ -17,9 +17,22 @@ class Text {
|
||||
// Com draw, però clippat a [clip_x_min, clip_x_max) × [clip_y_min, clip_y_max)
|
||||
void drawClipped(Uint32* pixel_data, int x, int y, const char* text, Uint32 color, int clip_x_min, int clip_x_max, int clip_y_min, int clip_y_max) const;
|
||||
|
||||
// Dibuixa text monoespaiat: cada glif ocupa `cell_w` i es centra dins la cel·la.
|
||||
// Útil per a comptadors (FPS, hora) on cada dígit pot tenir amplades diferents.
|
||||
void drawMono(Uint32* pixel_data, int x, int y, const char* text, Uint32 color, int cell_w) const;
|
||||
|
||||
// Mono només per a dígits (0-9): cada dígit ocupa `digit_cell_w` centrat;
|
||||
// la resta de glifs mantenen l'amplada natural. Ideal per a comptadors tipus "9:59.59".
|
||||
void drawMonoDigits(Uint32* pixel_data, int x, int y, const char* text, Uint32 color, int digit_cell_w) const;
|
||||
|
||||
// Calcula ancho en píxeles d'un text
|
||||
[[nodiscard]] auto width(const char* text) const -> int;
|
||||
// Amplada mono: nombre de codepoints × cell_w
|
||||
[[nodiscard]] auto widthMono(const char* text, int cell_w) const -> int;
|
||||
// Amplada mono-dígits: amplada natural, però substituint els dígits per digit_cell_w
|
||||
[[nodiscard]] auto widthMonoDigits(const char* text, int digit_cell_w) const -> int;
|
||||
[[nodiscard]] auto charHeight() const -> int { return box_height_; }
|
||||
[[nodiscard]] auto charBoxWidth() const -> int { return box_width_; }
|
||||
|
||||
private:
|
||||
struct GlyphInfo {
|
||||
|
||||
Reference in New Issue
Block a user