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

Method renderButton

Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp:555–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553//------------------------------------------------------------------------------
554
555void GuiBitmapButtonCtrl::renderButton( GFXTexHandle &texture, const Point2I &offset, const RectI& updateRect )
556{
557 GFX->getDrawUtil()->clearBitmapModulation();
558 GFX->getDrawUtil()->setBitmapModulation(mColor);
559
560 switch( mBitmapMode )
561 {
562 case BitmapStretched:
563 {
564 RectI rect( offset, getExtent() );
565 GFX->getDrawUtil()->drawBitmapStretch( texture, rect );
566 break;
567 }
568
569 case BitmapCentered:
570 {
571 Point2I p = offset;
572
573 p.x += getExtent().x / 2 - texture.getWidth() / 2;
574 p.y += getExtent().y / 2 - texture.getHeight() / 2;
575
576 GFX->getDrawUtil()->drawBitmap( texture, p );
577 break;
578 }
579 }
580}
581
582//=============================================================================
583// GuiBitmapButtonTextCtrl.

Callers

nothing calls this directly

Calls 8

clearBitmapModulationMethod · 0.80
getDrawUtilMethod · 0.80
setBitmapModulationMethod · 0.80
drawBitmapStretchMethod · 0.80
drawBitmapMethod · 0.80
Point2IClass · 0.50
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected