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


C++ BitmapText::SetGlobalDiffuseColor方法代码示例

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


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

示例1: Init


//.........这里部分代码省略.........
						title = title + "\n" + subtitle;
					text->SetMaxWidth( MaxWidth );
					text->SetText( title );
				}
				break;
			case UnlockRewardType_Course:
				{
					const Course *pCourse = entry.m_Course.ToCourse();
					ASSERT( pCourse != NULL );

					text->SetMaxWidth( MaxWidth );
					text->SetText( pCourse->GetDisplayFullTitle() );
					text->SetDiffuse( RageColor(0,1,0,1) );
				}
				break;
			default:
				text->SetText( "" );
				text->SetDiffuse( RageColor(0.5f,0,0,1) );
				break;
			}

			if( entry.IsLocked() )
			{
				text->SetText("???");
				text->SetZoomX(1);
			}
			else
			{
				// unlocked. change color
				const Song *pSong = entry.m_Song.ToSong();
				RageColor color = RageColor(1,1,1,1);
				if( pSong )
					color = SONGMAN->GetSongGroupColor(pSong->m_sGroupName);
				text->SetGlobalDiffuseColor(color);
			}

			text->SetXY( ScrollingTextX, ScrollingTextStartY );

			if (UNLOCK_TEXT_SCROLL == 3 && UNLOCK_TEXT_SCROLL_ROWS + i > NumUnlocks)
			{   // special command for last unlocks when scrolling is in effect
				float TargetRow = -0.5f + i + UNLOCK_TEXT_SCROLL_ROWS - NumUnlocks;
				float StopOffPoint = ScrollingTextEndY - TargetRow / UNLOCK_TEXT_SCROLL_ROWS * (ScrollingTextEndY - ScrollingTextStartY);
				float FirstCycleTime = (UNLOCK_TEXT_SCROLL_ROWS - TargetRow) * SECS_PER_CYCLE;
				float SecondCycleTime = (6 + TargetRow) * SECS_PER_CYCLE - FirstCycleTime;
				//LOG->Trace("Target Row: %f", TargetRow);
				//LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() );
				RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY);
				text->RunCommands( ActorUtil::ParseActorCommands(sCommand) );
			}
			else
			{
				RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY);
				text->RunCommands( ActorUtil::ParseActorCommands(sCommand) );
			}

			item.push_back(text);

			if (UNLOCK_TEXT_SCROLL >= 2)
			{
				Sprite* IconCount = new Sprite;

				// new unlock graphic
				IconCount->Load( THEME->GetPathG("ScreenUnlockStatus",ssprintf("%04d icon", i)) );

				// set graphic location
				IconCount->SetXY( UNLOCK_TEXT_SCROLL_ICON_X, ScrollingTextStartY);
开发者ID:Ancaro,项目名称:stepmania,代码行数:67,代码来源:ScreenUnlockStatus.cpp

示例2: ScreenAttract


//.........这里部分代码省略.........
			if (pSong && pSong->m_pSong != NULL)
			{
				CString title = pSong->m_pSong->GetDisplayMainTitle();
				CString subtitle = pSong->m_pSong->GetDisplaySubTitle();
				if( subtitle != "" )
					title = title + "\n" + subtitle;
				text->SetMaxWidth( MaxWidth );
				text->SetText( title );
			}
			else		 // song is missing, might be a course
			{
				Course *crs = SONGMAN->FindCourse( DisplayedSong );
				if (crs != NULL)
				{
					text->SetMaxWidth( MaxWidth );
					text->SetText( crs->GetFullDisplayTitle() );
					text->Command("Diffuse,0,1,0,1");
				}
				else   // entry isn't a song or course
				{
					text->SetText( "" );
					text->Command("Diffuse,0.5,0,0,1");
				}
			}

			if (pSong != NULL && pSong->m_pSong != NULL)
			{
				if( pSong->IsLocked() ) // song is locked
				{
					text->SetText("???");
					text->SetZoomX(1);
				} else {             // song is unlocked, change color
					RageColor color = SONGMAN->GetGroupColor(pSong->m_pSong->m_sGroupName);
					text->SetGlobalDiffuseColor(color);
				}
			}

			text->SetXY(ScrollingTextX, ScrollingTextStartY);

			if (UNLOCK_TEXT_SCROLL == 3 && UNLOCK_TEXT_SCROLL_ROWS + i > NumUnlocks)
			{   // special command for last unlocks when extreme-style scrolling is in effect
				float TargetRow = -0.5f + i + UNLOCK_TEXT_SCROLL_ROWS - NumUnlocks;
				float StopOffPoint = ScrollingTextEndY - TargetRow / UNLOCK_TEXT_SCROLL_ROWS * (ScrollingTextEndY - ScrollingTextStartY);
				float FirstCycleTime = (UNLOCK_TEXT_SCROLL_ROWS - TargetRow) * SECS_PER_CYCLE;
				float SecondCycleTime = (6 + TargetRow) * SECS_PER_CYCLE - FirstCycleTime;
				LOG->Trace("Target Row: %f", TargetRow);
				LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() );
				text->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY) );
			}
			else
				text->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY) );

			item.push_back(text);

			if (UNLOCK_TEXT_SCROLL >= 2)
			{
				Sprite* IconCount = new Sprite;

				// new unlock graphic
				IconCount->Load( THEME->GetPathToG(ssprintf("ScreenUnlock %d icon", i)) );

				// set graphic location
				IconCount->SetXY( UNLOCK_TEXT_SCROLL_ICON_X, ScrollingTextStartY);

				IconCount->SetHeight(UNLOCK_TEXT_SCROLL_ICON_SIZE);
				IconCount->SetWidth(UNLOCK_TEXT_SCROLL_ICON_SIZE);
开发者ID:augustg,项目名称:stepmania-3.9,代码行数:67,代码来源:ScreenUnlock.cpp


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