Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Since noone else wants to answer :-) I better do it myself (I hope that people are more eager to correct, if I am wrong!) As far as I see it, the best way is to create the image entirely in a bufferedImage, and then blit the hole image to the screen in one drawImage call (Wellknown method, I know) Sprites should be stored in a member of the Image-class because this will handle transparent areas. (Images are by default using the same depth as the screen, som they might consume a lot of space, if you have a large amount - But hey, RAM is getting cheaper by the month! :-) For fire and fog effects you will probably need som bufferedImages with alpha-channels, but keep them as few as possible, since they are slow to render. I made a couple of tests, trying to use Raster-objects, but since these are transformed to the destination-coordinates, they proved to be 2-3 times slower, than just using Image or BufferedImage classes. Using these methods, I can blit a 1024x768 screen w. 65K colors, full of 32x32 tiles + fifty 6K-pixel sprites + twentyfive 4K pixel alpha-images in about 40miliseconds on a 600MHz PIII. This is close to the maximum time I want it to use, but fortunately, it is not normal to redraw the *entire* screen every frame, so it could probably be optimzed by only blitting playfield, and only updating other areas when needed. Hope this helps someone! Regards Replies: |
Sponsored Links
|