Original Post
🔒 Locked
[java] Draw very large image
Advertisement
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.
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.
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...
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.
Advertisement