本文整理汇总了C++中LcdPanel::writeString方法的典型用法代码示例。如果您正苦于以下问题:C++ LcdPanel::writeString方法的具体用法?C++ LcdPanel::writeString怎么用?C++ LcdPanel::writeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LcdPanel
的用法示例。
在下文中一共展示了LcdPanel::writeString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: textTest
void textTest() {
const char *str="The quick brown fox";
Size size;
Point p;
uint32_t i,start;
prompt("Stream operators test");
*_gl << Point::Origin << "Let's see PI:";
for(i=0;i<=7;i++)
*_gl << Point(0,(1+i)*_font.getHeight()) << DoublePrecision(3.1415926535,i);
MillisecondTimer::delay(5000);
prompt("Opaque text test");
size=_gl->measureString(_font,str);
for(i=0,start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;i++) {
p.X=rand() % (_gl->getXmax()-size.Width);
p.Y=rand() % (_gl->getYmax()-size.Height);
_gl->setForeground(rand());
_gl->writeString(p,_font,str);
}
}
示例2: textTest
void textTest() {
int i;
const char *str="The quick brown fox";
Size size;
Point p;
uint32_t start,before,elapsed,chars;
prompt("Stream operators test");
*_gl << Point::Origin << "Let's see PI:";
for(i=0;i<=7;i++)
*_gl << Point(0,(1+i)*_font->getHeight()) << DoublePrecision(3.1415926535,i);
MillisecondTimer::delay(5000);
prompt("Opaque text test");
size=_gl->measureString(*_font,str);
before=MillisecondTimer::millis();
chars=0;
for(start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;) {
p.X=rand() % (_gl->getXmax()-size.Width);
p.Y=rand() % (_gl->getYmax()-size.Height);
_gl->setForeground(rand());
_gl->writeString(p,*_font,str);
chars+=19;
}
elapsed=MillisecondTimer::millis()-before;
_gl->clearScreen();
_gl->setForeground(ColourNames::WHITE);
*_gl << Point::Origin << (chars*1000/elapsed) << " characters/sec";
MillisecondTimer::delay(3000);
}