1、加载位图
void loadBkground()
{
bmpbackground="http://www.blog.com.cn/load_bmp"("img/bk.bmp",NULL);
if(!bmpBackground)
{
set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("read img/bk.bmp error");
}
set_color_depth(32);
bmpSprite=create_bitmap(bmpBackground->w,bmpBackground->h);
//blit(bmpBackground,bmpSprite,0,0,0,0,bmpBackground->w,bmpBackground->h);
blit(bmpBackground,screen,0,0,0,0,bmpBackground->w,bmpBackground->h);
}
void deleteBmp()
{
destroy_bitmap(bmpBackground);
destroy_bitmap(bmpSprite);
}
2、显示透明位图
void masked_blit(BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
3、缩放贴图
void stretch_blit(BITMAP *source, BITMAP *dest, int source_x, source_y, source_width, source_height, int dest_x, dest_y, dest_width, dest_height);
4、设置鼠标在某一状态的形状
set_mouse_cursor_bitmap(MOUSE_CURSOR_ARROW,bmpChui);
select_mouse_cursor(MOUSE_CURSOR_ARROW);
show_mouse(screen);
5、设置位图鼠标
set_mouse_sprite(bmpChui);
show_mouse(screen);
6、调用一个时间过程
int install_int(void (*proc)(), int speed);
7、延时
void rest(unsigned int time);
8、生成颜色
int makecol(int r, int g, int b);
9、显示字符
显示固定字符void textout_ex(BITMAP *bmp, const FONT *f, const char *s, int x, int y, int color, int bg);
显示变动字符void textprintf_ex(BITMAP *bmp, const FONT *f, int x, int y, int color, int bg, const char *fmt, ...);
|