C ++ Allegro 5 - 在初始化中缩放图像

时间:2012-05-03 10:49:38

标签: allegro5

如何在游戏的初始化部分使用allegro5调整初始化图像的大小?

ALLEGRO_BITMAP *player = NULL;
player = al_load_bitmap("st.png");
//something
al_draw_bitmap(player, player_position_x, player_position_y, 0);

1 个答案:

答案 0 :(得分:4)

而不是al_draw_bitmap()使用:

void al_draw_scaled_bitmap(ALLEGRO_BITMAP *bitmap,
   float sx, float sy, float sw, float sh,
   float dx, float dy, float dw, float dh, int flags);