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


C++ SColor::getInterpolated方法代码示例

本文整理汇总了C++中video::SColor::getInterpolated方法的典型用法代码示例。如果您正苦于以下问题:C++ SColor::getInterpolated方法的具体用法?C++ SColor::getInterpolated怎么用?C++ SColor::getInterpolated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在video::SColor的用法示例。


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

示例1: getColor

/** Used for drawing the background of dialogs and windows.
\param element: Pointer to the element which whiches to draw this. This parameter
is usually not used by ISkin, but can be used for example by more complex 
implementations to find out how to draw the part exactly. 
\param titleBarColor: Title color.
\param drawTitleBar: True to enable title drawing.
\param rect: Defining area where to draw.
\param clip: Clip area.
\return Returns rect where to draw title bar text. */
core::rect<s32> CGUISkin::draw3DWindowBackground(IGUIElement* element,
	bool drawTitleBar, video::SColor titleBarColor,
	const core::rect<s32>& r,
	const core::rect<s32>* cl)
{
	if (!Driver)
		return r;

	core::rect<s32> rect = r;

	rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;
	Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, cl);
	
	rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;
	Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, cl);

	rect.UpperLeftCorner.X = r.LowerRightCorner.X - 1;
	rect.LowerRightCorner.X = r.LowerRightCorner.X;
	rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y;
    rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, cl);

	rect.UpperLeftCorner.X -= 1;
	rect.LowerRightCorner.X -= 1;
	rect.UpperLeftCorner.Y += 1;
	rect.LowerRightCorner.Y -= 1;
	Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, cl);

	rect.UpperLeftCorner.X = r.UpperLeftCorner.X;
	rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;
	rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	rect.LowerRightCorner.X = r.LowerRightCorner.X;
	Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, cl);

	rect.UpperLeftCorner.X += 1;
	rect.LowerRightCorner.X -= 1;
	rect.UpperLeftCorner.Y -= 1;
	rect.LowerRightCorner.Y -= 1;
	Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, cl);

	rect = r;
	rect.UpperLeftCorner.X +=1;
	rect.UpperLeftCorner.Y +=1;
	rect.LowerRightCorner.X -= 2;
	rect.LowerRightCorner.Y -= 2;

	if (!UseGradient)
		Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, cl);
	else
	{
		video::SColor c2 = getColor(EGDC_3D_SHADOW);
		video::SColor c1 = getColor(EGDC_3D_FACE);
		Driver->draw2DRectangle(rect, c1, c1, c1, c2, cl);
	}
	
	rect = r;
	rect.UpperLeftCorner.X += 2;
	rect.UpperLeftCorner.Y += 2;
	rect.LowerRightCorner.X -= 2;
	rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + getSize(EGDS_WINDOW_BUTTON_WIDTH) + 2;
	
	if (drawTitleBar)
	{
		// draw title bar
		//if (!UseGradient)
		//	Driver->draw2DRectangle(titleBarColor, rect, cl);
		//else
		{
			video::SColor c = titleBarColor.getInterpolated(video::SColor(255,0,0,0), 0.2f);
			Driver->draw2DRectangle(rect, titleBarColor, c, titleBarColor, c, cl);
		}
	}

	return rect;
}
开发者ID:jivibounty,项目名称:irrlicht,代码行数:85,代码来源:CGUISkin.cpp


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