Пример #1
0
void TextBanner::Init()
{
	if( m_bInitted )
		return;
	m_bInitted = true;

	ASSERT( m_sName != "" );
	ARTIST_PREPEND_STRING.Refresh( m_sName );
	TWO_LINES_TITLE_COMMAND.Refresh( m_sName );
	TWO_LINES_SUBTITLE_COMMAND.Refresh( m_sName );
	TWO_LINES_ARTIST_COMMAND.Refresh( m_sName );
	THREE_LINES_TITLE_COMMAND.Refresh( m_sName );
	THREE_LINES_SUBTITLE_COMMAND.Refresh( m_sName );
	THREE_LINES_ARTIST_COMMAND.Refresh( m_sName );

	m_textTitle.SetName( "Title" );
	m_textTitle.LoadFromFont( THEME->GetPathToF("TextBanner") );
	SET_XY_AND_ON_COMMAND( m_textTitle );
	this->AddChild( &m_textTitle );

	m_textSubTitle.SetName( "Subtitle" );
	m_textSubTitle.LoadFromFont( THEME->GetPathToF("TextBanner") );
	SET_XY_AND_ON_COMMAND( m_textSubTitle );
	this->AddChild( &m_textSubTitle );

	m_textArtist.SetName( "Artist" );
	m_textArtist.LoadFromFont( THEME->GetPathToF("TextBanner") );
	SET_XY_AND_ON_COMMAND( m_textArtist );
	this->AddChild( &m_textArtist );
}
Пример #2
0
DifficultyDisplay::DifficultyDisplay()
{
	ICONONCOMMAND.Refresh();
	ICONOFFCOMMAND.Refresh();
	float fHeight = 0;
	int diff;
	for( diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff )
	{
		m_difficulty[diff].Load( THEME->GetPathToG(ssprintf("DifficultyDisplay bar %dx1",NUM_DIFFICULTIES)) );
		m_difficulty[diff].SetState(diff);
		m_difficulty[diff].StopAnimating();
		this->AddChild( &m_difficulty[diff] );

		fHeight += m_difficulty[diff].GetUnzoomedHeight();
	}

	float fY = -fHeight*0.5f;
	for( diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff )
	{
		m_difficulty[diff].SetHorizAlign( align_left );
		m_difficulty[diff].SetY( fY );
		fY += m_difficulty[diff].GetUnzoomedHeight();
	}
}