Jump to content
  • Advertisement
Sign in to follow this  
TheFlea

"background" in allegro

This topic is 4470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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++

Share this post


Link to post
Share on other sites
Advertisement
If I put the background like this ... i get an error ...

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

.

Share this post


Link to post
Share on other sites
For performance reasons, you really shouldn't use draw_sprite if there are no transparent pixels. Use blit() for copying solid bitmaps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!