|
Post by ultranet on Dec 14, 2007 21:19:09 GMT -5
I don't see any built-in function in Brutus2D that can change the depth/z-order/layer of sprite images. I don't want to manage the image priority by writing lots of codes. Other game engines do have this feature. They can set image depth/z-order/priority/layer by a built-in function. So will you add this feature in the future? Thanks.
|
|
|
Post by Guilect on Dec 15, 2007 11:17:38 GMT -5
|
|
|
Post by Guilect on Dec 15, 2007 19:39:50 GMT -5
I was thinking about the z-order some more. And this is what I was thinking.
B2D will need some new commands to implement this. There will be the set and get z-order commands. Also there will have to be a draw all images command, right. (because now we have to iterate through them all right before rendering to establish order).
I think this means that there would have to be a practical limit to the number of images allowed. Right now there is none. So let's say, 256. Also a limit on the number of z-order positions. Say, 7.
Why a limit. Because now every render loop we will need to loop through every image (256) and iterate that for every z-order position (7) in order to properly position the images.
psuedo code:
for numImages = 0 to 256 for numZOrders = 0 to 7 If image.zorder = numZOrder then draw_it_to_the_screen next numzOrders next numImages
so that means that every render loop now has to go through an additional (256 * 7) 1792 loops. Wether you use all of the 256 images or 7 layers of z-ordering or not.
This will make the rendering slow.
Anyone know of other ways? ....
But why is it that you just can't order the drawing of your images in the render loop properly to start with?
psuedo code:
draw stars draw planets draw space ship draw explosions
I mean you can set an image's visibility to false if you need not draw something to the screen.
pro's , con's....anyone?
|
|