本文整理汇总了C++中HUD::SetDisplayInt方法的典型用法代码示例。如果您正苦于以下问题:C++ HUD::SetDisplayInt方法的具体用法?C++ HUD::SetDisplayInt怎么用?C++ HUD::SetDisplayInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HUD
的用法示例。
在下文中一共展示了HUD::SetDisplayInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckLives
void CheckLives()
{
//game is in player displayer lives at top right
hud.SetDisplayInt(4, lives, 0.86f, 0.93f);
//levelnum
hud.SetDisplayInt(8, currentLevel, 0.52f, 0.93f);
//if game is over display final score
if(gameOver)
{
ShowScores();
hud.SetDisplayString(3, "", 0.0f, 0.0f);
hud.SetDisplayString(0, "", 0.3f, 0.55f);
hud.SetDisplayString(2, " Game Over\nYour Score:\n\n\n -High Scores-\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nBackspace = Restart", 0.4f, 0.65f);
hud.SetDisplayString(4, "", 0.3f, 0.55f);
}
//check if level is complete
if(nextLevel)
{
hud.SetDisplayString(3, "", 0.0f, 0.0f);
hud.SetDisplayString(0, "", 0.3f, 0.55f);
hud.SetDisplayString(2, "Level Complete!\n\nPress Enter to Progress", 0.3f, 0.55f);
hud.SetDisplayString(4, "", 0.3f, 0.55f);
}
}
示例2: CheckScore
void CheckScore()
{
if(!gameOver && !nextLevel)
hud.SetDisplayInt(1, score, 0.14f, 0.93f);
if(gameOver)
hud.SetDisplayInt(1, score, 0.56f, 0.62f);
if(!gameOver)
hud.SetDisplayInt(1, score, 0.14f, 0.93f);
if(nextLevel)
hud.SetDisplayInt(1, score, -10.14f, 0.93f);
}
示例3: UpdateTime
void UpdateTime()
{
if(!gameOver)
{
hud.SetDisplayInt(29, minutes, 0.25f, 0.01f);
//code to manually place a 0 before any seond number lower than 10
if(seconds < 10)
{
hud.SetDisplayString(31, "Playtime: : 0", 0.10f, 0.01f);
hud.SetDisplayInt(30, seconds, 0.31f, 0.01f);
}
else
{
hud.SetDisplayString(31, "Playtime: :", 0.10f, 0.01f);
hud.SetDisplayInt(30, seconds, 0.30f, 0.01f);
}
}
else
{
hud.SetDisplayInt(29, minutes, -100.25f, 0.01f);
//code to manually place a 0 before any seond number lower than 10
if(seconds < 10)
{
hud.SetDisplayString(31, "Playtime: : 0", -100.10f, 0.01f);
hud.SetDisplayInt(30, seconds, -100.31f, 0.01f);
}
else
{
hud.SetDisplayString(31, "Playtime: :", -100.10f, 0.01f);
hud.SetDisplayInt(30, seconds, -100.30f, 0.01f);
}
}
}
示例4: UnShowScores
void UnShowScores()
{
int count = 9;
for(int i = 0; i < 10; i++)
{
if(orderedScores[i] > 0)
{
hud.SetDisplayInt(count, 0, -100.55f, 0.5f - ((float)i/40));
char *display = &orderedNames[i][0];
count++;
hud.SetDisplayString(count, "", -100.4f, 0.5f - ((float)i/40));
count ++;
}
}
count = 0;
}