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

Method renderButton

Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp:495–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493//------------------------------------------------------------------------------
494
495void GuiBitmapButtonCtrl::renderButton( GFXTexHandle &texture, const Point2I &offset, const RectI& updateRect )
496{
497 GFX->getDrawUtil()->clearBitmapModulation();
498
499 switch( mBitmapMode )
500 {
501 case BitmapStretched:
502 {
503 RectI rect( offset, getExtent() );
504 GFX->getDrawUtil()->drawBitmapStretch( texture, rect );
505 break;
506 }
507
508 case BitmapCentered:
509 {
510 Point2I p = offset;
511
512 p.x += getExtent().x / 2 - texture.getWidth() / 2;
513 p.y += getExtent().y / 2 - texture.getHeight() / 2;
514
515 GFX->getDrawUtil()->drawBitmap( texture, p );
516 break;
517 }
518 }
519}
520
521//=============================================================================
522// GuiBitmapButtonTextCtrl.

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected