Sign in to follow this  

drawing sprites in a cirtain order

This topic is 3726 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to draw all of my object's sprites in a cirtain order. Just like it works in Windows, the last window clicked shows up on top, 2nd shows next, and so on. Is there any way to do something similar with my own objects? I have drop down lists. The first one draws, then the second one. If im using the first one and extend the list to select an item from it, the end of the list is under the 2nd drop down list because the 2nd list is drawn after the first. Since im using the first list, it needs to overlap every other object on the screen. Any ideas?

Share this post


Link to post
Share on other sites
Hi,

Did you include a depth information to your sprites (also known as Z order) ?

In 2D rendering you setup a z coordinate: 0 is topmost while greater values are behind. If you render multiple drop-down lists, always make sure the drop-down list which has keyboard (and/or mouse) focus has a z value of 0 (top most).

If you change focus to another drop-down list, just increase the z value of all other drop-down lists and set the z value of the new list to 0.

Rendering is then simple: you use the z values to determine the order of rendering.

Hope that helps.
Ghostly yours,
Red.

Share this post


Link to post
Share on other sites

This topic is 3726 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this