MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / onRender

Method onRender

engine/source/gui/guiTextCtrl.cc:204–228  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

202
203//------------------------------------------------------------------------------
204void GuiTextCtrl::onRender(Point2I offset, const RectI &updateRect)
205{
206 StringBuffer textBuffer(mText);
207
208 ColorI fontColor = mProfile->mFontColor;
209
210 if (mTruncateWhenUnfocused)
211 {
212 StringBuffer terminationString = "...";
213 S32 width = mBounds.extent.x;
214 StringBuffer truncatedBuffer = truncate(textBuffer, terminationString, width);
215 const UTF8* truncatedBufferPtr = truncatedBuffer.getPtr8();
216
217 dglSetBitmapModulation(fontColor);
218 renderJustifiedText(offset, mBounds.extent, (char*)truncatedBufferPtr);
219 }
220 else
221 {
222 dglSetBitmapModulation(fontColor);
223 renderJustifiedText(offset, mBounds.extent, (char*)mText);
224 }
225
226 //render the child controls
227 renderChildControls(offset, updateRect);
228}
229
230// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
231

Callers

nothing calls this directly

Calls 2

dglSetBitmapModulationFunction · 0.85
getPtr8Method · 0.80

Tested by

no test coverage detected