0

例如:

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;

}

这可能吗,或者如何将分数转换为 aconst char或 a string

4

1 回答 1

0

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

像这样的东西:

al_draw_textf(my_font, my_color, x_pos, y_pos, 0, "score = %d", score);
于 2013-10-16T13:56:53.847 回答