Пример #1
0
void drawShadowText( long colorTop, long colorShadow, HGOSFONT3D font, 
					long left, long top, long right, long bottom, bool proportional, const char* text, bool bold, float scale,
					long xOffset, long yOffset)
{
	gos_TextSetAttributes( font, colorShadow, scale, true, proportional, bold, false, 2 );
	gos_TextSetRegion( left + xOffset, top + yOffset, right + xOffset, bottom + yOffset);
	gos_TextSetPosition( left + xOffset, top + yOffset );
	gos_TextDraw( text );
	gos_TextSetAttributes( font, colorTop, scale, true, proportional, bold, false, 2 );
	gos_TextSetRegion( left, top, right, bottom );
	gos_TextSetPosition( left, top );
	gos_TextDraw( text );
}
Пример #2
0
void drawShadowText( long colorTop, long colorShadow, HGOSFONT3D font, 
					long left, long top, bool proportional, const char* text, bool bold, float scale,
					long xOffset, long yOffset)
{
	gos_TextSetAttributes( font, colorShadow, scale, false, proportional, bold, false, 0 );
	gos_TextSetRegion( 0, 0, Environment.screenWidth, Environment.screenHeight );
	gos_TextSetPosition( left + xOffset, top + yOffset );
	gos_TextDraw( text );
	gos_TextSetAttributes( font, colorTop, scale, false, proportional, bold, false, 0 );
	gos_TextSetPosition( left, top );
	gos_TextDraw( text );

}
Пример #3
0
void GameDebugWindow::render (void) {

	if (!display)
		return;

	long curY = pos[1] + 5;
	for (long i = linePos; i < MAX_DEBUG_WINDOW_LINES; i++) {
		gos_TextSetPosition(pos[0] + 5, curY);
		curY += fontHeight;
		gos_TextDraw(textBuffer[i]);
	}
	for (i = 0; i < linePos; i++) {
		gos_TextSetPosition(pos[0] + 5, curY);
		curY += fontHeight;
		gos_TextDraw(textBuffer[i]);
	}
}
Пример #4
0
void aButton::render()
{
	if ( state != HIDDEN )
	{
		if ( textureHandle )
		{
			unsigned long gosID = mcTextureManager->get_gosTextureHandle( textureHandle );
			gos_SetRenderState( gos_State_Texture, gosID ); 
		}
		else
			gos_SetRenderState( gos_State_Texture, 0 ); 

			gos_SetRenderState( gos_State_AlphaMode, gos_Alpha_AlphaInvAlpha);
			gos_SetRenderState( gos_State_Filter, gos_FilterNone);
			gos_SetRenderState( gos_State_AlphaTest, true);
			gos_SetRenderState( gos_State_TextureAddress, gos_TextureClamp );
			gos_SetRenderState( gos_State_TextureMapBlend,gos_BlendModulateAlpha );

			gos_DrawQuads( location, 4 );


		if ( data.textID && data.textFont )
		{
			char buffer[256];
			cLoadString( data.textID, buffer, 256 );
			DWORD width, height;
			gos_TextSetAttributes(data.textFont, data.textColors[state], data.textSize, true, true, false, false, data.textAlign);			
			gos_TextSetRegion( data.textRect.left, data.textRect.top, data.textRect.right, data.textRect.bottom );
			gos_TextStringLength( &width, &height, buffer );
			gos_TextSetPosition( data.textRect.left, (data.textRect.top + data.textRect.bottom)/2 - height/2 + 1 );
			gos_TextDraw( buffer );

			if ( data.outlineText )
			{
				drawEmptyRect( data.textRect, data.textColors[state], data.textColors[state] );
			}
		}
		if ( data.outline )
		{
			GUI_RECT tmp;
			tmp.left = location[0].x;
			tmp.top = location[0].y;
			tmp.right = location[2].x;
			tmp.bottom = location[2].y;

			drawEmptyRect( tmp, location[0].argb, location[0].argb );
		}

		for ( int i = 0; i < numberOfChildren(); i++ )
		{
			pChildren[i]->render();
		}
	}
}
Пример #5
0
void GameDebugWindow::render(void)
{
    if(!display)
        return;
    int32_t i;
    gos_TextSetAttributes(font, 0xffffffff, 1.0, true, true, false, false);
    gos_TextSetRegion(0, 0, Environment.screenWidth, Environment.screenHeight);
    int32_t curY = pos[1] + 5;
    for(i = linePos; i < MAX_DEBUG_WINDOW_LINES; i++)
    {
        gos_TextSetPosition(pos[0] + 5, curY);
        curY += fontHeight;
        gos_TextDraw(textBuffer[i]);
    }
    for(i = 0; i < linePos; i++)
    {
        gos_TextSetPosition(pos[0] + 5, curY);
        curY += fontHeight;
        gos_TextDraw(textBuffer[i]);
    }
}
Пример #6
0
void aFont::render( const char* text, int xPos, int yPos, int areaWidth, int areaHeight, 
				   unsigned long color, bool bBold, int alignment )
{
	gos_TextSetAttributes( gosFont, color, size, true, true, bBold, false, alignment );
	
	if ( areaWidth < 1 )
	{
		if ( alignment == 1 )
		{
			unsigned long width, height;
			gos_TextStringLength( &width, &height, text );
			xPos -= width;
			areaWidth = width + 1;
		}
		else
			areaWidth = Environment.screenWidth;
	}

	if ( areaHeight < 1 )
	{
		if ( alignment == 3  ) // bottom
		{
			unsigned long width, height;
			gos_TextStringLength( &width, &height, text );
			yPos -= height;
			areaHeight = height + 1;
		}
		
		else
			areaHeight = Environment.screenHeight;
	}

	gos_TextSetRegion( xPos, yPos, xPos + areaWidth, yPos + areaHeight );
	
	gos_TextSetPosition( xPos, yPos );
	gos_TextDraw( text );	

}