本文整理汇总了C++中UTFT::printNumI方法的典型用法代码示例。如果您正苦于以下问题:C++ UTFT::printNumI方法的具体用法?C++ UTFT::printNumI怎么用?C++ UTFT::printNumI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UTFT
的用法示例。
在下文中一共展示了UTFT::printNumI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onButtonPressed
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void SoundLevelScreen::onButtonPressed(TFTMenu* menu, int pressedButton)
{
UTFT* dc = menu->getDC();
dc->setColor(VGA_WHITE);
dc->setBackColor(VGA_BLUE);
int x_sound = 189;
int y_sound = 102;
if (pressedButton == backButton)
menu->switchToScreen("Settings");
else if (pressedButton == volumeLeftButton)
{
if (volumeSoundOff)
{
volumeSound -= 1;
if (volumeSound < 0)
{
volumeSound = 0;
}
Settings.setVolumeSound(volumeSound);
if (volumeSound < 10)
{
dc->printNumI(0, x_sound, y_sound);
dc->printNumI(volumeSound, x_sound + 16, y_sound);
}
else
{
dc->printNumI(volumeSound, x_sound, y_sound);
}
}
}
else if (pressedButton == volumeInfoButton)
{
volumeSoundStr = Settings.getVolumeSound();
volumeSoundOff = !volumeSoundOff;
if (!volumeSoundOff)
{
screenButtons->deleteButton(volumeInfoButton);
volumeInfoButton = screenButtons->addButton(165, 80, 80, 60, "m", BUTTON_SYMBOL); // кнопка
screenButtons->drawButton(volumeInfoButton);
}
else
{
screenButtons->deleteButton(volumeInfoButton);
volumeInfoButton = screenButtons->addButton(165, 80, 80, 60, volumeSoundStr.c_str()); // кнопка
screenButtons->drawButton(volumeInfoButton);
}
}
else if (pressedButton == volumeRightButton)
{
if (volumeSoundOff)
{
volumeSound += 1;
if (volumeSound > 30)
{
volumeSound = 30;
}
Settings.setVolumeSound(volumeSound);
if (volumeSound < 10)
{
dc->printNumI(0, x_sound, y_sound);
dc->printNumI(volumeSound, x_sound + 16, y_sound);
}
else
{
dc->printNumI(volumeSound, x_sound, y_sound);
}
}
}
}