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

Method onRender

Engine/source/gui/editor/guiEditCtrl.cpp:702–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700//-----------------------------------------------------------------------------
701
702void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect)
703{
704 Point2I ctOffset;
705 Point2I cext;
706 bool keyFocused = isFirstResponder();
707
708 GFXDrawUtil *drawer = GFX->getDrawUtil();
709
710 if (mActive)
711 {
712 if( getCurrentAddSet() != getContentControl() )
713 {
714 // draw a white frame inset around the current add set.
715 cext = getCurrentAddSet()->getExtent();
716 ctOffset = getCurrentAddSet()->localToGlobalCoord(Point2I(0,0));
717 RectI box(ctOffset.x, ctOffset.y, cext.x, cext.y);
718
719 box.inset( -5, -5 );
720 drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) );
721 box.inset( 1, 1 );
722 drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) );
723 box.inset( 1, 1 );
724 drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) );
725 box.inset( 1, 1 );
726 drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) );
727 box.inset( 1, 1 );
728 drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) );
729 }
730 Vector<GuiControl *>::iterator i;
731 bool multisel = mSelectedControls.size() > 1;
732 for(i = mSelectedControls.begin(); i != mSelectedControls.end(); i++)
733 {
734 GuiControl *ctrl = (*i);
735 cext = ctrl->getExtent();
736 ctOffset = ctrl->localToGlobalCoord(Point2I(0,0));
737 RectI box(ctOffset.x,ctOffset.y, cext.x, cext.y);
738 ColorI nutColor = multisel ? ColorI( 255, 255, 255, 100 ) : ColorI( 0, 0, 0, 100 );
739 ColorI outlineColor = multisel ? ColorI( 0, 0, 0, 100 ) : ColorI( 255, 255, 255, 100 );
740 if(!keyFocused)
741 nutColor.set( 128, 128, 128, 100 );
742
743 drawNuts(box, outlineColor, nutColor);
744 }
745 }
746
747 renderChildControls(offset, updateRect);
748
749 // Draw selection rectangle.
750
751 if( mActive && mMouseDownMode == DragSelecting )
752 {
753 RectI b;
754 getDragRect(b);
755 b.point += offset;
756
757 // Draw outline.
758
759 drawer->drawRect( b, ColorI( 100, 100, 100, 128 ) );

Callers

nothing calls this directly

Calls 15

getContentControlFunction · 0.85
mCeilFunction · 0.85
drawCrossSectionFunction · 0.85
getDrawUtilMethod · 0.80
getExtentMethod · 0.80
localToGlobalCoordMethod · 0.80
insetMethod · 0.80
drawRectMethod · 0.80
drawRectFillMethod · 0.80
setBlendMethod · 0.80
setCullModeMethod · 0.80
createStateBlockMethod · 0.80

Tested by

no test coverage detected