"background" in allegro
Hi i have a problem with my simple game. I don't know how to put in background a picture (.bmp). I put in my game trees , people , and other things... but in background i have only black...and i want to chance this thing
One more question ...I use a buffer for draw at my screen so I draw my picture in a buffer and the buffer in my screen ... This is good or bad..I tink... i can draw only to screen...
I use C++
If I put the background like this ... i get an error ...
Thz in advence
draw_sprite(buffer,backgound,800,600)draw_sprite(buffer, image1, image1_x_position, image1_y_position) draw_sprite(buffer, image2, 500, 300); draw_sprite(buffer, image2, 300, 100); draw_sprite(buffer, image2, 200, 50); draw_sprite(buffer, image2, 50, 50);
Thz in advence
Quote:Original post by TheFlea
If I put the background like this ... i get an error ...
*** Source Snippet Removed ***
Thz in advence
Only error I see there is that blitting to 800, 600 might put it right off the screen (did you mean 0, 0?) Assuming background is a valid BITMAP*, that should work fine.
Do'h.. Yes .. i want to put my image to (0,0) not at (800,600) ...
and my image was not valid BITMAP* ... Problem solved...This is the great forum for programming
.
and my image was not valid BITMAP* ... Problem solved...This is the great forum for programming
.
For performance reasons, you really shouldn't use draw_sprite if there are no transparent pixels. Use blit() for copying solid bitmaps.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement