例如:
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 char
或string
?
答案 0 :(得分:0)
您可以使用al_draw_textf使用printf样式的格式字符串打印字符串。
这样的事情:
al_draw_textf(my_font, my_color, x_pos, y_pos, 0, "score = %d", score);