本文整理汇总了C++中BitmapText::SetZoomX方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapText::SetZoomX方法的具体用法?C++ BitmapText::SetZoomX怎么用?C++ BitmapText::SetZoomX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapText
的用法示例。
在下文中一共展示了BitmapText::SetZoomX方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadFromWheelItemData
void MusicWheelItem::LoadFromWheelItemData( WheelItemData* pWID )
{
ASSERT( pWID != NULL );
data = pWID;
/*
// copy all data items
this->m_Type = pWID->m_Type;
this->m_sSectionName = pWID->m_sSectionName;
this->m_pCourse = pWID->m_pCourse;
this->m_pSong = pWID->m_pSong;
this->m_color = pWID->m_color;
this->m_Type = pWID->m_Type; */
// init type specific stuff
switch( pWID->m_Type )
{
case TYPE_SECTION:
case TYPE_COURSE:
case TYPE_SORT:
{
CString sDisplayName, sTranslitName;
BitmapText *bt = NULL;
switch( pWID->m_Type )
{
case TYPE_SECTION:
sDisplayName = SONGMAN->ShortenGroupName(data->m_sSectionName);
bt = &m_textSectionName;
break;
case TYPE_COURSE:
sDisplayName = data->m_pCourse->GetFullDisplayTitle();
sTranslitName = data->m_pCourse->GetFullTranslitTitle();
bt = &m_textCourse;
break;
case TYPE_SORT:
sDisplayName = data->m_sLabel;
bt = &m_textSort;
break;
default:
ASSERT(0);
}
bt->SetZoom( 1 );
bt->SetText( sDisplayName, sTranslitName );
bt->SetDiffuse( data->m_color );
bt->TurnRainbowOff();
const float fSourcePixelWidth = (float)bt->GetUnzoomedWidth();
const float fMaxTextWidth = 200;
if( fSourcePixelWidth > fMaxTextWidth )
bt->SetZoomX( fMaxTextWidth / fSourcePixelWidth );
}
break;
case TYPE_SONG:
{
m_TextBanner.LoadFromSong( data->m_pSong );
m_TextBanner.SetDiffuse( data->m_color );
m_WheelNotifyIcon.SetFlags( data->m_Flags );
RefreshGrades();
}
break;
case TYPE_ROULETTE:
m_textRoulette.SetText( THEME->GetMetric("MusicWheel","Roulette") );
break;
case TYPE_RANDOM:
m_textRoulette.SetText( THEME->GetMetric("MusicWheel","Random") );
break;
case TYPE_PORTAL:
m_textRoulette.SetText( THEME->GetMetric("MusicWheel","Portal") );
break;
default:
ASSERT( 0 ); // invalid type
}
}
示例2: Init
//.........这里部分代码省略.........
{
case UnlockRewardType_Song:
{
const Song *pSong = entry.m_Song.ToSong();
ASSERT( pSong != NULL );
RString title = pSong->GetDisplayMainTitle();
RString subtitle = pSong->GetDisplaySubTitle();
if( subtitle != "" )
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);
示例3: ScreenAttract
//.........这里部分代码省略.........
text->SetHorizAlign( Actor::align_left );
text->SetZoom(ScrollingTextZoom);
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);