diff options
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/client/gfx.c | 18 | ||||
| -rw-r--r-- | src/engine/interface.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/engine/client/gfx.c b/src/engine/client/gfx.c index e2aa1c81..05ebcb1c 100644 --- a/src/engine/client/gfx.c +++ b/src/engine/client/gfx.c @@ -807,12 +807,28 @@ static int word_length(const char *text) } } + + +static float pretty_r=1; +static float pretty_g=1; +static float pretty_b=1; +static float pretty_a=1; + +void gfx_pretty_text_color(float r, float g, float b, float a) +{ + pretty_r = r; + pretty_g = g; + pretty_b = b; + pretty_a = a; +} + float gfx_pretty_text_raw(float x, float y, float size, const char *text_, int length) { const unsigned char *text = (unsigned char *)text_; const float spacing = 0.05f; gfx_texture_set(current_font->font_texture); gfx_quads_begin(); + gfx_setcolor(pretty_r, pretty_g, pretty_b, pretty_a); if(length < 0) length = strlen(text_); @@ -847,6 +863,8 @@ float gfx_pretty_text_raw(float x, float y, float size, const char *text_, int l return x; } + + void gfx_pretty_text(float x, float y, float size, const char *text, int max_width) { if(max_width == -1) diff --git a/src/engine/interface.h b/src/engine/interface.h index 8c272000..abe447c4 100644 --- a/src/engine/interface.h +++ b/src/engine/interface.h @@ -813,6 +813,8 @@ int client_serverbrowse_num_requests(); void client_serverbrowse_update(); /* undocumented graphics stuff */ + +void gfx_pretty_text_color(float r, float g, float b, float a); void gfx_pretty_text(float x, float y, float size, const char *text, int max_width); float gfx_pretty_text_width(float size, const char *text, int length); |