MCPcopy Create free account
hub / github.com/InkboxSoftware/all-screen-keyboard / text

Method text

keyboard/src/text.cpp:5–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "text.h"
4
5text::text(const char* inputString, int x, int y, float newSize, int r, int g, int b, int a){
6 outputString = inputString;
7
8
9 //turn coordinates and color into openGL format
10 float windowWidthHalf = 2560.0f * 0.5f;
11 float windowHeightHalf = 1440.0f * 0.5f;
12
13 locationX = (static_cast<float>(x) - windowWidthHalf) / windowWidthHalf;
14 locationY = -((static_cast<float>(y) - windowHeightHalf) / windowHeightHalf);
15 size = newSize;
16
17 c.r = static_cast<float>(r) / 255.0f;
18 c.g = static_cast<float>(g) / 255.0f;
19 c.b = static_cast<float>(b) / 255.0f;
20 c.a = static_cast<float>(a) / 255.0f;
21 return;
22}
23
24const char* text::getText(){
25 return outputString.c_str();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected