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

Method onRender

Engine/source/gui/controls/guiConsoleTextCtrl.cpp:131–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void GuiConsoleTextCtrl::onRender( Point2I offset, const RectI &updateRect )
132{
133 RectI ctrlRect( offset, getExtent() );
134
135 // if opaque, fill the update rect with the fill color
136 if ( mProfile->mOpaque )
137 GFX->getDrawUtil()->drawRectFill( ctrlRect, mProfile->mFillColor );
138
139 // if there's a border, draw the border
140 if ( mProfile->mBorder )
141 renderBorder( ctrlRect, mProfile );
142
143 // If we have text to render.
144 if ( mResult.isNotEmpty() )
145 {
146 GFont *font = mProfile->mFont;
147
148 GFX->getDrawUtil()->setBitmapModulation( mProfile->mFontColor );
149
150 for ( U32 i = 0; i < mLineLen.size(); i++ )
151 {
152 Point2I tempOffset = offset;
153 tempOffset += mProfile->mTextOffset;
154 tempOffset.y += i * font->getHeight();
155
156 const UTF8 *line = mResult.c_str() + mStartLineOffset[i];
157 U32 lineLen = mLineLen[i];
158 GFX->getDrawUtil()->drawTextN( font, tempOffset, line, lineLen, mProfile->mFontColors );
159 }
160 }
161
162 // render the child controlsmResult
163 renderChildControls(offset, updateRect);
164}
165
166const char *GuiConsoleTextCtrl::getScriptValue()
167{

Callers

nothing calls this directly

Calls 9

renderBorderFunction · 0.85
drawRectFillMethod · 0.80
getDrawUtilMethod · 0.80
setBitmapModulationMethod · 0.80
drawTextNMethod · 0.80
isNotEmptyMethod · 0.45
sizeMethod · 0.45
getHeightMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected