MCPcopy Create free account
hub / github.com/devkitPro/3ds-hbmenu / textDrawInBox

Function textDrawInBox

source/text.c:148–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void textDrawInBox(const char* text, int orientation, float scaleX, float scaleY, float baseline, float left, float right)
149{
150 float bwidth = right-left;
151 float twidth = scaleX*textCalcWidth(text);
152 if (twidth > bwidth)
153 {
154 scaleX *= bwidth / twidth;
155 twidth = bwidth;
156 }
157 float x;
158 if (orientation < 0)
159 x = left;
160 else if (orientation > 0)
161 x = floorf(right-twidth);
162 else
163 x = left + floorf((bwidth-twidth)/2);
164 textDraw(x, baseline, scaleX, scaleY, true, text);
165}

Callers 8

networkDrawBotFunction · 0.85
drawingBottomScreenFunction · 0.85
errorDrawBotFunction · 0.85
menuDrawTopFunction · 0.85
menuDrawEntryFunction · 0.85
menuDrawBotFunction · 0.85
backgroundDrawTopFunction · 0.85
titleSelectDrawBotFunction · 0.85

Calls 2

textCalcWidthFunction · 0.85
textDrawFunction · 0.85

Tested by

no test coverage detected