Jump to content

ajuda-allegro mouse


seuqram
 Share

Recommended Posts

eu estou a fazer um jogo em allegro e quando eu estava a aprender a faze-lo  não percebi uma coisa:

#include <allegro.h>

int main()
{
   allegro_init();
   set_color_depth(32);
   install_mouse();// Instala o mouse
   install_keyboard();
   set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
   BITMAP *bmpMouse = NULL;
   bmpMouse = create_bitmap(100,100);
   bmpMouse = load_bitmap("mouse.bmp",NULL);
   BITMAP *Buffer = NULL;
   Buffer = create_bitmap(640,480);
   set_mouse_sprite(bmpMouse); 
   while( !key[KEY_ESC] )
   {
textprintf(Buffer,font,0,0,makecol(255,100,200),"Mouse x: %d", mouse_x);
textprintf(Buffer,font,0,10,makecol(255,100,200),"Mouse y: %d", mouse_y);
show_mouse(Buffer); 
blit(Buffer,screen,0,0,0,0,SCREEN_W,SCREEN_H);       
   }
}
END_OF_MAIN();

    

o que é a funçao:  set_mouse_sprite(bmpMouse);  ?

e a funçao:  blit(Buffer,screen,0,0,0,0,SCREEN_W,SCREEN_H);  ?   

Link to comment
Share on other sites

90% das dúvidas podem ser respondidas neste site : http://alleg.sourceforge.net/stabledocs/en/allegro.html

set_mouse_sprite : altera a imagem do rato

http://www.liballeg.org/stabledocs/en//alleg004.html#set_mouse_sprite

blit : copia uma porção de uma imagem para outra

http://www.liballeg.org/stabledocs/en//alleg014.html#blit

IRC : sim, é algo que ainda existe >> #p@p
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.