本文整理汇总了C++中CDrawPort::SetFont方法的典型用法代码示例。如果您正苦于以下问题:C++ CDrawPort::SetFont方法的具体用法?C++ CDrawPort::SetFont怎么用?C++ CDrawPort::SetFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDrawPort
的用法示例。
在下文中一共展示了CDrawPort::SetFont方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Credits_Render
// render credits to given drawport
FLOAT Credits_Render(CDrawPort *pdp)
{
if (!_bCreditsOn) {
return 0;
}
CDrawPort dpWide;
pdp->MakeWideScreen(&dpWide);
pdp->Unlock();
dpWide.Lock();
FLOAT fTime = GetTime();
pixW = dpWide.GetWidth();
pixH = dpWide.GetHeight();
fResolutionScaling = (FLOAT)pixW / 640.0f;
dpWide.SetFont( _pfdDisplayFont);
pixLineHeight = floor(20*fResolutionScaling);
const FLOAT fLinesPerSecond = _fSpeed;
FLOAT fOffset = fTime*fLinesPerSecond;
INDEX ctLinesOnScreen = pixH/pixLineHeight;
INDEX iLine1 = fOffset;
pixJ = iLine1*pixLineHeight-fOffset*pixLineHeight;
iLine1-=ctLinesOnScreen;
INDEX ctLines = _astrCredits.Count();
BOOL bOver = TRUE;
for (INDEX i = iLine1; i<iLine1+ctLinesOnScreen+1; i++) {
CTString *pstr = &strEmpty;
INDEX iLine = i;
if (iLine>=0 && iLine<ctLines) {
pstr = &_astrCredits[iLine];
bOver = FALSE;
}
PrintOneLine(&dpWide, *pstr);
}
dpWide.Unlock();
pdp->Lock();
if (bOver) {
return 0;
} else if (ctLines-iLine1<ctLinesOnScreen) {
return FLOAT(ctLines-iLine1)/ctLinesOnScreen;
} else {
return 1;
}
}