예제 #1
0
void NumberControl::processRender(const GsRect<float> &RectDispCoordFloat)
{
    // Transform to the display coordinates
    GsRect<float> displayRect = mRect;
    displayRect.transform(RectDispCoordFloat);
    SDL_Rect lRect = displayRect.SDLRect();

    GsWeakSurface blitsfc(gVideoDriver.getBlitSurface());

    if(!mEnabled)
    {
        mTextDisabledSfc.blitTo(blitsfc, lRect);
    }
    else
    {
        if(mHovered)
        {
            if(mDecSel)
                mTextLightSfcL.blitTo(blitsfc, lRect);
            else if(mIncSel)
                mTextLightSfcR.blitTo(blitsfc, lRect);
            else
                mTextLightSfc.blitTo(blitsfc, lRect);
        }
        else // Button is not hovered
        {
            mTextDarkSfc.blitTo(blitsfc, lRect);
        }
    }

    drawBlinker(lRect);
}
예제 #2
0
void CGUINumberControl::processRender(const GsRect<float> &RectDispCoordFloat)
{

	// Transform to the display coordinates
	GsRect<float> displayRect = mRect;
	displayRect.transform(RectDispCoordFloat);
    GsRect<Uint16> lRect(displayRect);

    GsWeakSurface blitsfc(gVideoDriver.getBlitSurface());

    if( mReleased )
    {
        blitsfc.drawRect( lRect, 1, 0x00BBBBBB, 0x00CFCFCF );
    }
    else if( mPressed )
    {
        blitsfc.drawRect( lRect, 1, 0x00BBBBBB, 0x00DFDFDF );
    }
    else if( mHovered )
    {
        blitsfc.drawRect( lRect, 1, 0x00BBBBBB, 0x00EFEFEF );
    }
    else
    {
        blitsfc.drawRect( lRect, 1, 0x00BBBBBB, 0x00FFFFFF );
    }

    // Now lets draw the text of the list control
    GsFont &Font = gGraphics.getFont(mFontID);

    Font.drawFontCentered( blitsfc,
                           mText,
                           lRect,
                           false );
}
예제 #3
0
void NumberControl::processRender(const GsRect<float> &RectDispCoordFloat)
{
	// Transform to the display coordinates
	GsRect<float> displayRect = mRect;
	displayRect.transform(RectDispCoordFloat);
	SDL_Rect lRect = displayRect.SDLRect();

    GsWeakSurface blitsfc(gVideoDriver.getBlitSurface());

    // Now lets draw the text of the list control
    GsFont &Font = gGraphics.getFont(mFontID);

    Font.drawFont( blitsfc, mText, lRect.x+24, lRect.y, false );
    Font.drawFont( blitsfc, ":", lRect.x+24+mText.size()*8, lRect.y, false );

    if(mSlider)
    {
        gGraphics.getFont(2).drawFont( blitsfc, sliderStr(), lRect.x+16+(mText.size()+2)*8, lRect.y, false );
    }
    else
    {
        std::string text = (mDecSel) ? "\025" : " ";
        text += itoa(mValue);
        if(mIncSel)
            text += static_cast<char>(17);
        else
            text += " ";

        Font.drawFont( blitsfc, text, lRect.x+24+(mText.size()+2)*8, lRect.y, false );
    }

    drawTwirl(lRect);

}
예제 #4
0
void GalaxyButton::processRender(const GsRect<float> &RectDispCoordFloat)
{
    // Transform to the display coordinates
    GsRect<float> displayRect = mRect;
    displayRect.transform(RectDispCoordFloat);
    SDL_Rect lRect = displayRect.SDLRect();

    GsWeakSurface blitsfc( gVideoDriver.getBlitSurface() );

    if(!mEnabled)
    {
        mTextDisabledSfc.blitTo(blitsfc, lRect);
    }
    else
    {
        drawEnabledButton(blitsfc, lRect, mHovered);
    }

    drawBlinker(lRect);
}
예제 #5
0
void BorderedButton::processRender(const GsRect<float> &RectDispCoordFloat)
{
    // Transform to the display coordinates
    GsRect<float> displayRect = mRect;

    displayRect.transform(RectDispCoordFloat);
    SDL_Rect lRect = displayRect.SDLRect();

    GsWeakSurface blitsfc( gVideoDriver.getBlitSurface() );

    Uint32 newcolor;

    if(!mEnabled)
        newcolor = blitsfc.mapRGB(123, 150, 123);
    else if(mHovered || mPressed)
        newcolor = blitsfc.mapRGB(84, 234, 84);
    else
        newcolor = blitsfc.mapRGB(38, 134, 38);

    blitsfc.drawFrameRect( lRect, 1, newcolor);

    lRect.y +=2;
    lRect.x +=2;

    if(!mEnabled)
    {
        mTextDisabledSfc.blitTo(blitsfc, lRect);
    }
    else
    {
        if(mHovered)
        {
            drawEnabledButton(blitsfc, lRect, true);
        }
        else
        {
            drawEnabledButton(blitsfc, lRect, false);
        }
    }
}