Exemplo n.º 1
0
	void cWidgetComboBox::OnDraw(float a_fTimeStep, cGuiClipRegion *a_pClipRegion)
	{
		if (m_bMenuOpen)
		{
			m_pSet->DrawGfx(m_pGfxBackground,GetGlobalPosition() + cVector3f(0,m_vSize.y-m_fMenuHeight,1),
				cVector2f(m_vSize.x, m_fMenuHeight));

			DrawBordersAndCorners(NULL, m_vGfxBorders, m_vGfxCorners,
				GetGlobalPosition() + cVector3f(0,m_vSize.y-m_fMenuHeight,1.4f),
				cVector2f(m_vSize.x, m_fMenuHeight));
		}
	}
Exemplo n.º 2
0
	void cWidgetComboBox::OnDraw(float afTimeStep, cGuiClipRegion *apClipRegion)
	{
		if(mbMenuOpen)
		{
			mpSet->DrawGfx(mpGfxBackground,GetGlobalPosition() + cVector3f(0,mvSize.y-mfMenuHeight,1),
							cVector2f(mvSize.x, mfMenuHeight));

			////////////////////////////////
			// Background and borders
			DrawBordersAndCorners(	NULL, mvGfxBorders, mvGfxCorners, 
									GetGlobalPosition() + cVector3f(0,mvSize.y-mfMenuHeight,1.4f),
									cVector2f(mvSize.x, mfMenuHeight));
		}
	}
Exemplo n.º 3
0
	void cWidgetFrame::OnDraw(float afTimeStep, cGuiClipRegion *apClipRegion)
	{
		////////////////////////////////
		// Borders
		if(mbDrawFrame)
		{
			//Background must be drawn first!
			DrawBordersAndCorners(	NULL, mvGfxBorders, mvGfxCorners,
									GetGlobalPosition() -
										cVector3f(	mvGfxCorners[0]->GetActiveSize().x,
													mvGfxCorners[0]->GetActiveSize().y,0),
									mvSize +	mvGfxCorners[0]->GetActiveSize() +
												mvGfxCorners[2]->GetActiveSize());
		}
	}
Exemplo n.º 4
0
void cWidgetListBox::OnDraw(float afTimeStep, cGuiClipRegion *apClipRegion)
{
    ////////////////////////////////
    // Background
    mpSet->DrawGfx(	mpGfxBackground,GetGlobalPosition() +cVector3f(0,0,mfBackgroundZ),
                    mvSize);


    ////////////////////////////////
    // Borders
    DrawBordersAndCorners(	NULL, mvGfxBorders, mvGfxCorners,
                            GetGlobalPosition() -
                            cVector3f(	mvGfxCorners[0]->GetActiveSize().x,
                                        mvGfxCorners[0]->GetActiveSize().y,0),
                            mvSize +	mvGfxCorners[0]->GetActiveSize() +
                            mvGfxCorners[2]->GetActiveSize());
}
Exemplo n.º 5
0
	void cWidgetTextBox::OnDraw(float afTimeStep, cGuiClipRegion *apClipRegion)
	{
		////////////////////////////////
		// Text
		cVector3f vTextAdd = cVector3f(3,2,0.2f) + mvGfxCorners[0]->GetActiveSize();
		DrawDefaultText(cString::SubW(msText,mlFirstVisibleChar,mlVisibleCharSize),
						GetGlobalPosition()+ vTextAdd,
						eFontAlign_Left);

		//Marker
		if(mlMarkerCharPos >=0)
		{
			float fMarkerPos = CharToLocalPos(mlMarkerCharPos);
			mpSet->DrawGfx(	mpGfxMarker,GetGlobalPosition() + vTextAdd + cVector3f(fMarkerPos,0,0.1f),
							cVector2f(2, mvDefaultFontSize.y));

			//Selected text
			if(mlSelectedTextEnd >=0)
			{
				float fSelectEnd = CharToLocalPos(mlSelectedTextEnd);

				float fPos = fSelectEnd < fMarkerPos ? fSelectEnd : fMarkerPos;
				float fEnd = fSelectEnd > fMarkerPos ? fSelectEnd : fMarkerPos;
				
				if(fPos <0)fPos =0;
				if(fEnd > mfTextMaxSize) fEnd = mfTextMaxSize;
				
				float fSize = fEnd - fPos;

				mpSet->DrawGfx( mpGfxSelectedTextBack, GetGlobalPosition() + 
								vTextAdd + cVector3f(fPos,0,0.2f),
								cVector2f(fSize,mvDefaultFontSize.y));
			}
		}

		
		////////////////////////////////
		// Background and Borders
		DrawBordersAndCorners(	mpGfxBackground, mvGfxBorders, mvGfxCorners, 
								GetGlobalPosition(), mvSize);
	}
Exemplo n.º 6
0
	void cWidgetWindow::OnDraw(float afTimeStep, cGuiClipRegion *apClipRegion)
	{
		////////////////////////////////
		// Calc label size
		cVector2f vLabelSize;
		vLabelSize.x = mvSize.x - (mvGfxCorners[0]->GetActiveSize().x + mvGfxCorners[1]->GetActiveSize().x);
		vLabelSize.y = mpLabelFont->mvSize.y + mvLabelTextOffset.y*2;

		////////////////////////////////
		// Label
		mpSet->DrawGfx(	mpGfxLabel,GetGlobalPosition() + 
						cVector3f(mvGfxCorners[0]->GetActiveSize().x,mvGfxCorners[0]->GetActiveSize().y,0.2f),
						vLabelSize);

		////////////////////////////////
		// Label text
		DrawSkinText(	msText,eGuiSkinFont_WindowLabel,GetGlobalPosition()+
						cVector3f(	mvGfxCorners[0]->GetActiveSize().x+mvLabelTextOffset.x,
									mvGfxCorners[0]->GetActiveSize().y+mvLabelTextOffset.y,0.4f));

		////////////////////////////////
		// Borders and background
		DrawBordersAndCorners(	mpGfxBackground, mvGfxBorders, mvGfxCorners, GetGlobalPosition(), mvSize);
	}