MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / displayText

Method displayText

engine/src/text.cpp:32–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void Font::displayText(float x, float y, float w, float h,
33 float r, float g, float b, const char *string)
34{
35 float w_x = x;
36 float w_y = y + h;
37 int length = static_cast<int>(strlen(string));
38
39 float ds = w / 8.0f;
40
41 glBindTexture(GL_TEXTURE_2D, *(atlas->texture));
42 glColor4f(r, g, b, 1.0f);
43
44 for (int i = 0; i < length; i++)
45 {
46 BitmapCharacter(w_x, w_y, w, -h, string[i]);
47 w_x += w + w_spacing[string[i]];
48 }
49}
50
51void Font::displayTextNoSpacing(float x, float y, float w, float h,
52 float r, float g, float b, const char *string)

Callers 2

R_drawMenusFunction · 0.80
R_drawSelectedMenuItemFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected