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

Method displayScreenText

engine/src/text.cpp:70–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void Font::displayScreenText(int x, int y, float r, float g, float b, const char *string)
71{
72 float w = charsXYWH.w * scaleValue;
73 float h = charsXYWH.h * scaleValue;
74
75 int length = static_cast<int>(strlen(string));
76
77 glBindTexture(GL_TEXTURE_2D, *(atlas->texture));
78 glColor4f(r, g, b, 1.0f);
79 for (int i = 0; i < length; i++)
80 {
81 BitmapCharacter(x, y - h, w, h, string[i]);
82 x += w + s_spacing[string[i]];
83 }
84}
85
86void Font::BitmapCharacter(float x, float y, float w, float h, int character)
87{

Callers 2

R_drawScreenDebugFunction · 0.80
R_renderFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected