首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Allegro5:把int放在屏幕上

Allegro5:把int放在屏幕上
EN

Stack Overflow用户
提问于 2013-10-15 16:29:33
回答 1查看 212关注 0票数 0

例如:

代码语言:javascript
复制
int score = 20;

int main(){
    al_draw_text(foo, foo, foo, foo, foo, "SCORE");

    //I would then like to print the score to the screen,
    // is there anyway to do this?   


   al_rest(1000);

   return 0;

}

这是可能的吗?还是把分数转换成const charstring

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-16 13:56:53

您可以使用al使用printf样式的格式字符串打印字符串。

就像这样:

代码语言:javascript
复制
al_draw_textf(my_font, my_color, x_pos, y_pos, 0, "score = %d", score);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19386320

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档