Skip to main content
gamedev.net
🔒 Locked

[java] Draw very large image

Started by blow 1 reply 600+ views
Original Post
blow
blow
What's the best way to draw a large image unless decrese perfomance? I use a large image to draw terrain, like "worms" game, but i think i cant use tile system, right? plz help me
Paclaw
Paclaw
I think that if you have only one big image it should be ok.

I would create a compatible image of the graphicDevice you plan to use then store the image in a BufferedImage called for ie background.

Then for the render operation I would do everything offscreen, so basically creating another BufferedImage and draw background into it and continue with rendering the other element.

finally draw the offscreen to the screen.

The offscreen could be handled with a doublebufferstrategy.
Paclaw
blow
blow
Hi, thank for reply, i use a frame whit bufferstrategy and a compatible image of large image.
If i draw simply the large image my best fps is 130..if i divide the large image in tiles,(256x256) and i draw all tiles whit a for cicle, i have 400-450 fps!
So use tiles is best, but my game is like "worms", so my terrain have to destroy under fire. Whit tiles are more tricky to do this...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.