Ejemplo n.º 1
0
void CAniText::Create (const CString &sText,
					   const CVector &vPos,
					   const CG16bitFont *pFont,
					   DWORD dwFontFlags,
					   WORD wColor,
					   IAnimatron **retpAni)

//	Create
//
//	Creates text with basic attributes

	{
	CAniText *pText = new CAniText;
	pText->SetPropertyString(PROP_TEXT, sText);
	pText->SetPropertyVector(PROP_POSITION, vPos);
	pText->SetPropertyFont(PROP_FONT, pFont);
	pText->SetFontFlags(dwFontFlags);
	pText->SetPropertyColor(PROP_COLOR, wColor);

	if (dwFontFlags & CG16bitFont::AlignCenter)
		pText->SetPropertyString(PROP_TEXT_ALIGN_HORZ, ALIGN_CENTER);
	else if (dwFontFlags & CG16bitFont::AlignRight)
		pText->SetPropertyString(PROP_TEXT_ALIGN_HORZ, ALIGN_RIGHT);

	*retpAni = pText;
	}
Ejemplo n.º 2
0
void CAniVScroller::AddTextLine (const CString &sText, const CG16bitFont *pFont, WORD wColor, DWORD dwFlags, int cyExtra)

//	AddTextLine
//
//	Adds a new line of text at the bottom

{
    CAniText *pLine = new CAniText;
    pLine->SetPropertyVector(PROP_POSITION, CVector(0.0, m_cyEnd + cyExtra));
    pLine->SetPropertyString(PROP_TEXT, sText);
    pLine->SetPropertyColor(PROP_COLOR, wColor);
    pLine->SetPropertyFont(PROP_FONT, pFont);
    pLine->SetFontFlags(dwFlags);

    AddLine(pLine);
}
Ejemplo n.º 3
0
void CTranscendenceWnd::CreateScoreAnimation (const CGameRecord &Stats, IAnimatron **retpAnimatron)

//	CreateScoreAnimation
//
//	Creates an animation of the given score

	{
	int i;
	int iDuration = 300;
	int x = m_rcIntroMain.left + RectWidth(m_rcIntroMain) / 2;
	int y = m_rcIntroMain.bottom - RectHeight(m_rcIntroMain) / 3;

	//	Create sequencer to hold everything

	CAniSequencer *pSeq = new CAniSequencer;

	//	Create the score

	CAniText *pCredit = new CAniText;
	pCredit->SetPropertyVector(CONSTLIT("position"), CVector((Metric)x, (Metric)y));
	pCredit->SetPropertyColor(CONSTLIT("color"), m_Fonts.rgbTitleColor);
	pCredit->SetPropertyString(CONSTLIT("text"), strFromInt(Stats.GetScore()));

	pCredit->SetPropertyFont(CONSTLIT("font"), &m_Fonts.Title);
	pCredit->SetFontFlags(CG16bitFont::AlignCenter);

	pCredit->AnimateLinearFade(iDuration, 30, 30);

	pSeq->AddTrack(pCredit, 0);
	y += m_Fonts.Title.GetHeight();

	//	Player name

	CAniText *pName = new CAniText;
	pName->SetPropertyVector(CONSTLIT("position"), CVector((Metric)x, (Metric)y));
	pName->SetPropertyColor(CONSTLIT("color"), m_Fonts.rgbTextColor);
	pName->SetPropertyString(CONSTLIT("text"), Stats.GetPlayerName());

	pName->SetPropertyFont(CONSTLIT("font"), &m_Fonts.SubTitle);
	pName->SetFontFlags(CG16bitFont::AlignCenter);

	pName->AnimateLinearFade(iDuration, 30, 30);

	pSeq->AddTrack(pName, 5);
	y += m_Fonts.SubTitle.GetHeight();

	//	Epitaph

	TArray<CString> EpitaphLines;
	m_Fonts.Header.BreakText(strCapitalize(Stats.GetEndGameEpitaph()), 512, &EpitaphLines);

	for (i = 0; i < EpitaphLines.GetCount(); i++)
		{
		CAniText *pLine = new CAniText;
		pLine->SetPropertyVector(CONSTLIT("position"), CVector((Metric)x, (Metric)y));
		pLine->SetPropertyColor(CONSTLIT("color"), m_Fonts.rgbTextColor);
		pLine->SetPropertyString(CONSTLIT("text"), EpitaphLines[i]);

		pLine->SetPropertyFont(CONSTLIT("font"), &m_Fonts.Header);
		pLine->SetFontFlags(CG16bitFont::AlignCenter);

		pLine->AnimateLinearFade(iDuration, 30, 30);

		pSeq->AddTrack(pLine, 5);
		y += m_Fonts.Header.GetHeight();
		}

	//	Done

	*retpAnimatron = pSeq;
	}