如何使用 Allegro 等库增加显示文本的大小? C

How can I increase the size of the displayed text using a library like Allegro? C

如何更改显示字体的大小以显示以下条目:

al_draw_textf(font, al_map_rgb(204, 255, 255), WIDTH / 2, 50,\
              ALLEGRO_ALIGN_CENTER, "%d : %d", pl1.scope, pl2.scope);

创建了一个我正在尝试调整大小的标准 ASCII 字体。

ALLEGRO_FONT* font = al_create_builtin_font();

Display of the players' score. (img)

这是第一款游戏,之前除了控制台程序什么都没做


  1. 正如al_create_builtin_font() - liballeg指出的那样:

ALLEGRO_FONT *al_create_builtin_font(void)

Creates a monochrome bitmap font (8x8 pixels per character).

This font is primarily intended to be used for displaying information in environments or during early runtime states where no external font data is available or loaded (e.g. for debugging).

  1. 为了调整字体大小,从 local/system 存储库加载字体。

al_load_font() :

ALLEGRO_FONT *al_load_font(char const *filename, int size, int flags)
  1. 将您的字体与游戏打包,加载它们变得更容易。