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

Method onRender

Engine/source/gui/buttons/guiSwatchButtonCtrl.cpp:92–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void GuiSwatchButtonCtrl::onRender( Point2I offset, const RectI &updateRect )
93{
94 bool highlight = mHighlighted;
95
96 ColorI borderColor = mActive ? ( highlight ? mProfile->mBorderColorHL : mProfile->mBorderColor ) : mProfile->mBorderColorNA;
97
98 RectI renderRect( offset, getExtent() );
99 if ( !highlight )
100 renderRect.inset( 1, 1 );
101
102 GFXDrawUtil *drawer = GFX->getDrawUtil();
103 drawer->clearBitmapModulation();
104
105 // Draw background transparency grid texture...
106 if ( mGrid.isValid() )
107 drawer->drawBitmapStretch( mGrid, renderRect );
108
109 // Draw swatch color as fill...
110 drawer->drawRectFill(renderRect, mSwatchColor.toColorI());
111
112 // Draw any borders...
113 drawer->drawRect( renderRect, borderColor );
114}
115
116//-----------------------------------------------------------------------------
117

Callers

nothing calls this directly

Calls 8

insetMethod · 0.80
getDrawUtilMethod · 0.80
clearBitmapModulationMethod · 0.80
drawBitmapStretchMethod · 0.80
drawRectFillMethod · 0.80
toColorIMethod · 0.80
drawRectMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected