Page 1 of 1
the Z axis for the sprites ?
Posted: Tue May 26, 2009 2:42 pm
by dobro
I know the first sprite is displayed the most profound, however an option in displaysprite will be a better
example :
DisplaySprite(#eraser ,0,0,[depth ])
the parameter 'depth ' is the Z depth display
Style:
DisplaySprite (#eraser, 0,0,0)
DisplaySprite (#ball, 0,0,2)
#eraser is behind #ball!
be optional as it could keep the current system
with
DisplaySprite (#eraser, 0.0)
it is my idea good?

Posted: Tue May 26, 2009 2:53 pm
by AND51
I think it would be better to call it "z-order", not "z-axis". Axis is related with the 3D lib.
I would like to improve your syntax. Here is my
suggestion #1
Code: Select all
DisplaySprite(SpriteID, x, y[, z-order])
Whereas z-order goes from -infinity to +infinity:
0 is the default, -1 is behind the default layer, +4 is in front of the default layer.
To keep the commandset compatible with future versions, here is my
suggestion #2
Code: Select all
DisplaySprite(#eraser, 0, 0)
DisplaySprite(#ball, 0, 0)
SetSpriteOrder(#eraser, -1)
SetSpriteOrder(#ball, 0)
FlipBuffers()
#eraser is behind #ball!
Posted: Tue May 26, 2009 3:11 pm
by dobro
yes , why not

Posted: Tue May 26, 2009 3:15 pm
by freak
There are no "layers" for sprites. Thats why it is called 2D

Posted: Tue May 26, 2009 3:25 pm
by TazNormand
OK, no layers for sprites, but why not include it ?
cool would be management of 2 layer (Amiga playfield like), just to say sprite number "n" is top over all others sprites.
Imagine : easier way to make parallax scrollings, ability of a sprite to move alternatively front/behind another one or image (man walking like SOTB in a forest) !!!
Djes on French forum suggest to use linked list, maybe i'll use it
Posted: Tue May 26, 2009 4:30 pm
by Kaeru Gaman
it's a completely different approach.
Sprites are just Brushes.
they are no Objects wich have certain positions, you can display the same sprite x times every frame.
when you display a Sprite, the pixels of the Sprites are copied into the screenbuffer, overwriting those wich have been there before.
All Oldskool Mates: forget the Term Sprite!
they are Brushes! or call them Decals, if you like that better.
Imagine : easier way to make parallax scrollings, ability of a sprite to move alternatively front/behind another one or image (man walking like SOTB in a forest) !!!
No, no, no!
this is a problem of YOUR Engine, how you write it, what you enable it to do and what not.
when you want a handling like that, create an appropriate object management.
so please, now all let's repeat in choir:
A Sprite is just a Brush!
Posted: Tue May 26, 2009 4:42 pm
by Fluid Byte
I don't get it ...
What's the friggin' point of this? The sprites appear in the order you call them in your source code. Why on earth you would need an extra command for that?
Posted: Tue May 26, 2009 5:24 pm
by DoubleDutch
If you need a Z order, just do it in software. Have an array of the sprite numbers you want to draw and the z order. Sort to the Z order then draw them in that order.
You could draw them if reverse Y order if you want them to appear with some kind of depth? Doesn't look good in some cases though.