当前位置: 首页>>代码示例>>C++>>正文


C++ UI_FillRect函数代码示例

本文整理汇总了C++中UI_FillRect函数的典型用法代码示例。如果您正苦于以下问题:C++ UI_FillRect函数的具体用法?C++ UI_FillRect怎么用?C++ UI_FillRect使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UI_FillRect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UI_Preview_Ownerdraw

static void UI_Preview_Ownerdraw( void *self )
{
	menuCommon_s	*item = (menuCommon_s *)self;
	UI_FillRect( item->x - 2, item->y - 2, item->width + 4, item->height + 4, 0xFFC0C0C0 );
	UI_FillRect( item->x, item->y, item->width, item->height, 0xFF808080 );
	PIC_Set( uiFileDialog.image, 255, 255, 255, 255 );
	PIC_DrawTrans( item->x, item->y, item->width, item->height );
}
开发者ID:DeadZoneLuna,项目名称:cs16-client,代码行数:8,代码来源:menu_filedialog.cpp

示例2: UI_Preview_Ownerdraw

static void UI_Preview_Ownerdraw( void *self )
{
    menuCommon_s	*item = (menuCommon_s *)self;
    UI_FillRect( item->x - 2, item->y - 2, item->width + 4, item->height + 4, 0xFFC0C0C0 );
    UI_FillRect( item->x, item->y, item->width, item->height, 0xFF808080 );
    PIC_Set( uiTouchButtons.textureid, CURCOLOR1(red), CURCOLOR1(green), CURCOLOR1(blue), CURCOLOR1(alpha));
    if( uiTouchButtons.additive.enabled )
        PIC_DrawAdditive( item->x, item->y, item->width, item->height );
    else
        PIC_DrawTrans( item->x, item->y, item->width, item->height );
}
开发者ID:nekonomicon,项目名称:xash3d,代码行数:11,代码来源:menu_touchbuttons.cpp

示例3: UI_Cinematics_Ownerdraw

/*
 ==================
 UI_Cinematics_Ownerdraw
 ==================
*/
static void UI_Cinematics_Ownerdraw (void *self){

	menuCommon_t	*item = (menuCommon_t *)self;
	int				x = 566, y = 210, w = 412, h = 348;

	if (item->id == ID_CINPREVIEW){
		UI_ScaleCoords(&x, &y, &w, &h);

		// Draw black background, cinematic frame and box
		UI_FillRect(x, y, w, h, colorBlack);

		if (uiStatic.playingCinematic){
//			CIN_UpdateCinematic();
//			CIN_DrawCinematic();
		}

		UI_DrawPic(item->x, item->y, item->width, item->height, colorWhite, ((menuBitmap_t *)self)->pic);
	}
	else {
		if (uiCinematics.menu.items[uiCinematics.menu.cursor] == self)
			UI_DrawPic(item->x, item->y, item->width, item->height, colorWhite, UI_MOVEBOXFOCUS);
		else
			UI_DrawPic(item->x, item->y, item->width, item->height, colorWhite, UI_MOVEBOX);

		UI_DrawPic(item->x, item->y, item->width, item->height, colorWhite, ((menuBitmap_t *)self)->pic);
	}
}
开发者ID:Mirrorman95,项目名称:quake-2-evolved,代码行数:32,代码来源:ui_cinematics.c

示例4: UI_DrawTextBox

void UI_DrawTextBox(int x, int y, int width, int lines)
{
    UI_FillRect(x + BIGCHAR_WIDTH / 2, y + BIGCHAR_HEIGHT / 2, (width + 1) * BIGCHAR_WIDTH,
                (lines + 1) * BIGCHAR_HEIGHT, colorBlack);
    UI_DrawRect(x + BIGCHAR_WIDTH / 2, y + BIGCHAR_HEIGHT / 2, (width + 1) * BIGCHAR_WIDTH,
                (lines + 1) * BIGCHAR_HEIGHT, colorWhite, uiInfo.uiDC.whiteShader);
}
开发者ID:Zekom,项目名称:reaction,代码行数:7,代码来源:ui_atoms.c

示例5: UI_PlayerSetup_Ownerdraw

/*
=================
UI_PlayerSetup_Ownerdraw
=================
*/
static void UI_PlayerSetup_Ownerdraw( void *self )
{
	menuCommon_s	*item = (menuCommon_s *)self;

	// draw the background
	UI_FillRect( item->x, item->y, item->width, item->height, uiPromptBgColor );

	// draw the rectangle
	UI_DrawRectangle( item->x, item->y, item->width, item->height, uiInputFgColor );

	if( !ui_showmodels->value && playerImage != 0 )
	{
		PIC_Set( playerImage, 255, 255, 255, 255 );
		PIC_Draw( item->x, item->y, item->width, item->height );
	}
	else
	{
		R_ClearScene ();

		// update renderer timings
		uiPlayerSetup.refdef.time = gpGlobals->time;
		uiPlayerSetup.refdef.frametime = gpGlobals->frametime;
		uiPlayerSetup.ent->curstate.body = 0; // clearing body each frame

		// draw the player model
		R_AddEntity( ET_NORMAL, uiPlayerSetup.ent );
		R_RenderFrame( &uiPlayerSetup.refdef );
	}
}
开发者ID:Rhoin,项目名称:Xash3D-CrossPlatform-Port,代码行数:34,代码来源:menu_playersetup.cpp

示例6: UI_SaveConfigMenu_SavenameDraw

/*
 * UI_SaveConfigMenu_SavenameDraw
 */
static void
UI_SaveConfigMenu_SavenameDraw(void *self)
{
	menufield_s *f;
	int style;
	float *color;

	f = (menufield_s*)self;

	if(f == Menu_ItemAtCursor(&saveConfig.menu)){
		style	= UI_LEFT|UI_PULSE|UI_SMALLFONT;
		color	= text_color_highlight;
	}else{
		style	= UI_LEFT|UI_SMALLFONT;
		color	= colorRed;
	}

	UI_DrawProportionalString(320, 192, "Enter filename:", UI_CENTER|
		UI_SMALLFONT,
		color_orange);
	UI_FillRect(f->generic.x, f->generic.y, f->field.widthInChars*
		SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT,
		colorBlack);
	MField_Draw(&f->field, f->generic.x, f->generic.y, style, color);
}
开发者ID:icanhas,项目名称:yantar,代码行数:28,代码来源:saveconfig.c

示例7: JKG_Slice_DrawGridSummary

void JKG_Slice_DrawGridSummary(int slot, float x, float y, float w, float h) {
	static const vec4_t topcol = {.2, 1, .2, 0.2f};
	static const vec4_t botcol = {1, 0.2, 0.2, 0.2f};

	int orientation = (slot >> 3) & 1;		// 0 = Columns, 1 = Rows
	int index = slot & 7;

	vec4_t color;

	const char *text;

	float w2;

	if ((orientation == 0 && index >= sliceData.width) || (orientation == 1 && index >= sliceData.height) ) {
		UI_DrawRect(x, y, w, h, disabled);
		return;
	} else {
		UI_FillRect(x, y, w, h/2, topcol);
		UI_FillRect(x, y + (0.5f * h), w, h/2, botcol);
		if (sliceData.inputState == INPUTSTATE_AWAITINGLINE) {
			float phase = 0.7f + sin((float)trap->Milliseconds() / 150.0f) * 0.1f;
			MAKERGBA(color, phase, phase, phase, 1.0f);
			UI_DrawRect(x, y, w, h, color);
		} else {
			UI_DrawRect(x, y, w, h, black);
		}
	}


	if (sliceData.summariesKnown) {
		text = va("%i", sliceData.summaries[slot].value);
		w2 = trap->R_Font_StrLenPixels(text, MenuFontToHandle(0), 1.0f) * 0.4f;
		DC->drawText(x + (w/2) - (w2/2), y-1, 0.4f, const_cast<float *>(white), text, 0, 0, 0, 0 );

		text = va("%i", sliceData.summaries[slot].alarms);
		w2 = trap->R_Font_StrLenPixels(text, MenuFontToHandle(0), 1.0f) * 0.4f;
		DC->drawText(x + (w/2) - (w2/2), y+(h*0.5f)-1, 0.4f, const_cast<float *>(white), text, 0, 0, 0, 0 );
	} else {
		text = "?";
		w2 = trap->R_Font_StrLenPixels(text, MenuFontToHandle(0), 1.0f) * 0.4f;
		DC->drawText(x + (w/2) - (w2/2), y-1, 0.4f, const_cast<float *>(white), text, 0, 0, 0, 0 );

		w2 = trap->R_Font_StrLenPixels(text, MenuFontToHandle(0), 1.0f) * 0.4f;
		DC->drawText(x + (w/2) - (w2/2), y+(h*0.5f)-1, 0.4f, const_cast<float *>(white), text, 0, 0, 0, 0 );
	}

}
开发者ID:lNightCrawlerl,项目名称:JediKnightGalaxies,代码行数:47,代码来源:jkg_slice.cpp

示例8: ScrollList_Draw

/*
=================
ScrollList_Draw
=================
*/
void ScrollList_Draw( menulist_s *l )
{
	int			x;
	int			u;
	int			y;
	int			i;
	int			base;
	int			column;
	float*		color;
	qboolean	hasfocus;
	int			style;

	hasfocus = (l->generic.parent->cursor == l->generic.menuPosition);

	x =	l->generic.x;
	for( column = 0; column < l->columns; column++ ) {
		y =	l->generic.y;
		base = l->top + column * l->height;
		for( i = base; i < base + l->height; i++) {
			if (i >= l->numitems)
				break;

			if (i == l->curvalue)
			{
				u = x - 2;
				if( l->generic.flags & QMF_CENTER_JUSTIFY ) {
					u -= (l->width * SMALLCHAR_WIDTH) / 2 + 1;
				}

				UI_FillRect(u,y,l->width*SMALLCHAR_WIDTH,SMALLCHAR_HEIGHT+2,listbar_color);
				color = text_color_highlight;

				if (hasfocus)
					style = UI_PULSE|UI_LEFT|UI_SMALLFONT;
				else
					style = UI_LEFT|UI_SMALLFONT;
			}
			else
			{
				color = text_color_normal;
				style = UI_LEFT|UI_SMALLFONT;
			}
			if( l->generic.flags & QMF_CENTER_JUSTIFY ) {
				style |= UI_CENTER;
			}

			UI_DrawString(
				x,
				y,
				l->itemnames[i],
				style,
				color);

			y += SMALLCHAR_HEIGHT;
		}
		x += (l->width + l->seperation) * SMALLCHAR_WIDTH;
	}
}
开发者ID:Barbatos,项目名称:ioq3-bumpy-UrbanTerror-4.x,代码行数:63,代码来源:ui_qmenu.c

示例9: MenuField_Draw

/*
==================
MenuField_Draw
==================
*/
void MenuField_Draw( menufield_s *f )
{
    int		x;
    int		y;
    int		w;
    int		h;
    int		style;
    qboolean focus;
    float	*color;

    x =	f->generic.x;
    y =	f->generic.y;

    if (f->generic.flags & QMF_SMALLFONT)
    {
        w = SMALLCHAR_WIDTH;
        h = SMALLCHAR_HEIGHT;
        style = UI_SMALLFONT;
    }
    else
    {
        w = BIGCHAR_WIDTH;
        h = BIGCHAR_HEIGHT;
        style = UI_BIGFONT;
    }

    if (Menu_ItemAtCursor( f->generic.parent ) == f)
    {
        focus = qtrue;
        style |= UI_PULSE;
    }
    else
    {
        focus = qfalse;
    }

    if (f->generic.flags & QMF_GRAYED)
        color = text_color_disabled;
    else if (focus)
        color = text_color_highlight;
    else
        color = text_color_normal;

    if ( focus )
    {
        // draw cursor
        UI_FillRect( f->generic.left, f->generic.top, f->generic.right-f->generic.left+1, f->generic.bottom-f->generic.top+1, listbar_color );
        UI_DrawChar( x, y, 13, UI_CENTER|UI_BLINK|style, color);
    }

    if ( f->generic.name )
    {
        UI_DrawString( x - w, y, f->generic.name, style|UI_RIGHT, color );
    }

    MField_Draw( &f->field, x + w, y, style, color );
}
开发者ID:zturtleman,项目名称:recoil,代码行数:62,代码来源:ui_mfield.c

示例10: UI_CDKeyMenu_DrawKey

/*
=================
UI_CDKeyMenu_DrawKey
=================
*/
static void UI_CDKeyMenu_DrawKey( void *self ) {
	menufield_s		*f;
	qboolean		focus;
	int				style;
	char			c;
	float			*color;
	int				x, y;
	int				val;

	f = (menufield_s *)self;

	focus = (f->generic.parent->cursor == f->generic.menuPosition);

	style = UI_LEFT;
	if( focus ) {
		color = color_yellow;
	}
	else {
		color = color_orange;
	}

	x = 320 - 8 * BIGCHAR_WIDTH;
	y = 240 - BIGCHAR_HEIGHT / 2;
	UI_FillRect( x, y, 16 * BIGCHAR_WIDTH, BIGCHAR_HEIGHT, listbar_color );
	UI_DrawString( x, y, f->field.buffer, style, color );

	// draw cursor if we have focus
	if( focus ) {
		if ( trap_Key_GetOverstrikeMode() ) {
			c = 11;
		} else {
			c = 10;
		}

		style &= ~UI_PULSE;
		style |= UI_BLINK;

		UI_DrawChar( x + f->field.cursor * BIGCHAR_WIDTH, y, c, style, color_white );
	}

	val = UI_CDKeyMenu_PreValidateKey( f->field.buffer );
	if( val == 1 ) {
		UI_DrawProportionalString( 320, 376, "Please enter your CD Key", UI_CENTER|UI_SMALLFONT, color_yellow );
	}
	else if ( val == 0 ) {
		UI_DrawProportionalString( 320, 376, "The CD Key appears to be valid, thank you", UI_CENTER|UI_SMALLFONT, color_white );
	}
	else {
		UI_DrawProportionalString( 320, 376, "The CD Key is not valid", UI_CENTER|UI_SMALLFONT, color_red );
	}
}
开发者ID:Clever-Boy,项目名称:entityplus,代码行数:56,代码来源:ui_cdkey.c

示例11: RadioButton_Draw

/*
=================
RadioButton_Draw
=================
*/
static void RadioButton_Draw( menuradiobutton_s *rb )
{
	int	x;
	int y;
	float *color;
	int	style;
	qboolean focus;

	x = rb->generic.x;
	y = rb->generic.y;

	focus = (rb->generic.parent->cursor == rb->generic.menuPosition);

	if ( rb->generic.flags & QMF_GRAYED )
	{
		color = text_color_disabled;
		style = UI_LEFT|UI_SMALLFONT;
	}
	else if ( focus )
	{
		color = text_color_highlight;
		style = UI_LEFT|UI_PULSE|UI_SMALLFONT;
	}
	else
	{
		color = text_color_normal;
		style = UI_LEFT|UI_SMALLFONT;
	}

	if ( focus )
	{
		// draw cursor
		UI_FillRect( rb->generic.left, rb->generic.top, rb->generic.right-rb->generic.left+1, rb->generic.bottom-rb->generic.top+1, listbar_color ); 
		UI_DrawChar( x, y, 13, UI_CENTER|UI_BLINK|UI_SMALLFONT, color);
	}

	if ( rb->generic.name )
		UI_DrawString( x - SMALLCHAR_WIDTH, y, rb->generic.name, UI_RIGHT|UI_SMALLFONT, color );

	if ( !rb->curvalue )
	{
		UI_DrawHandlePic( x + SMALLCHAR_WIDTH, y + 2, 16, 16, uis.rb_off);
		UI_DrawString( x + SMALLCHAR_WIDTH + 16, y, "off", style, color );
	}
	else
	{
		UI_DrawHandlePic( x + SMALLCHAR_WIDTH, y + 2, 16, 16, uis.rb_on );
		UI_DrawString( x + SMALLCHAR_WIDTH + 16, y, "on", style, color );
	}
}
开发者ID:Barbatos,项目名称:ioq3-bumpy-UrbanTerror-4.x,代码行数:55,代码来源:ui_qmenu.c

示例12: UI_CreditMenu

/*
===============
UI_CreditMenu
===============
*/
void UI_CreditMenu( void ) {
	/* This UI_FillRect() hack will blank the borders if you're in widescreen,
	   so you get a completely black background instead of stripes from the
	   previous frame on each side of the credits.. */
	const float black[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
	UI_FillRect(0 - uis.xbias, 0, (640.0f / uis.xscale) * 2.0f, 480.0f / uis.yscale, black);

	memset( &s_credits, 0 ,sizeof(s_credits) );

	s_credits.menu.draw = UI_CreditMenu_Draw;
	s_credits.menu.key = UI_CreditMenu_Key;
	s_credits.menu.fullscreen = qtrue;
	UI_PushMenu ( &s_credits.menu );
}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:19,代码来源:ui_credits.c

示例13: JKG_Slice_DrawSecurityClearance

void JKG_Slice_DrawSecurityClearance(int slot, float x, float y, float w, float h) {

	const char *text;

	float w2;

	if (slot >= sliceData.securityLevels) {
		UI_DrawRect(x, y, w, h, disabled);
		return;
	} else {
		switch (sliceData.securityState[slot])
		{
			case 0:
				UI_FillRect(x, y, w, h, red);
				break;
			case 1:
				UI_FillRect(x, y, w, h, orange);
				break;
			case 2:
				UI_FillRect(x, y, w, h, yellow);
				break;
			case 3:
				UI_FillRect(x, y, w, h, green);
				break;
		}

		UI_DrawRect(x, y, w, h, black);
	}


	text = va("%i", slot + 1);
	
	w2 = trap->R_Font_StrLenPixels(text, MenuFontToHandle(0), 1.0f) * 0.5f;
	DC->drawText(x + (w/2) - (w2/2), y+(h*0.2f), 0.5f, const_cast<float *>(white), text, 0, 0, 0, 0 );

}
开发者ID:lNightCrawlerl,项目名称:JediKnightGalaxies,代码行数:36,代码来源:jkg_slice.cpp

示例14: UI_DrawRectangleExt

/*
=================
UI_DrawRectangleExt
=================
*/
void UI_DrawRectangleExt( int in_x, int in_y, int in_w, int in_h, const int color, int outlineWidth )
{
	int	x, y, w, h;

	x = in_x - outlineWidth;
	y = in_y - outlineWidth;
	w = outlineWidth;
	h = in_h + outlineWidth + outlineWidth;

	// draw left
	UI_FillRect( x, y, w, h, color );

	x = in_x + in_w;
	y = in_y - outlineWidth;
	w = outlineWidth;
	h = in_h + outlineWidth + outlineWidth;

	// draw right
	UI_FillRect( x, y, w, h, color );

	x = in_x;
	y = in_y - outlineWidth;
	w = in_w;
	h = outlineWidth;

	// draw top
	UI_FillRect( x, y, w, h, color );

	// draw bottom
	x = in_x;
	y = in_y + in_h;
	w = in_w;
	h = outlineWidth;

	UI_FillRect( x, y, w, h, color );
}
开发者ID:DavidKnight247,项目名称:xash3d,代码行数:41,代码来源:basemenu.cpp

示例15: UI_Credits_DrawFunc

/*
=================
UI_Credits_DrawFunc
=================
*/
static void UI_Credits_DrawFunc( void )
{
	int	i, y;
	float	speed = 32.0f * (768.0f / ScreenHeight);
	int	w = UI_SMALL_CHAR_WIDTH;
	int	h = UI_SMALL_CHAR_HEIGHT;
	int	color = 0x00FFA000;

	// draw the background first
	UI_FillRect( 0, 0, ScreenWidth, ScreenHeight, uiColorBlack );

	// now draw the credits
	UI_ScaleCoords( NULL, NULL, &w, &h );

	y = ScreenHeight - (((gpGlobals->time * 1000) - uiCredits.startTime ) / speed );

	// draw the credits
	for ( i = 0; i < uiCredits.numLines && uiCredits.credits[i]; i++, y += h )
	{
		// skip not visible lines, but always draw end line
		if( y <= -h && i != uiCredits.numLines - 1 ) continue;

		if(( y < ( ScreenHeight - h ) / 2 ) && i == uiCredits.numLines - 1 )
		{
			if( !uiCredits.fadeTime ) uiCredits.fadeTime = (gpGlobals->time * 1000);
			color = UI_FadeAlpha( uiCredits.fadeTime, uiCredits.showTime );
			if( UnpackAlpha( color ))
				UI_DrawString( 0, ( ScreenHeight - h ) / 2, ScreenWidth, h, uiCredits.credits[i], color, true, w, h, 1, true );
		}
		else UI_DrawString( 0, y, ScreenWidth, h, uiCredits.credits[i], uiColorWhite, false, w, h, 1, true );
	}

	if( y < 0 && UnpackAlpha( color ) == 0 )
	{
		uiCredits.active = false; // end of credits
	}

	if( !uiCredits.active )
		UI_PopMenu();
}
开发者ID:lewa-j,项目名称:cs16-client,代码行数:45,代码来源:menu_credits.cpp


注:本文中的UI_FillRect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。