Sprite Depth Order

sterlingy

Active Member
Licensed User
Longtime User
Is it possible to change the depth of a sprite?

I have new objects being created and I want them behind other objects that are already initialized and on the screen. I want the old objects on top.

-Sterling
 

sterlingy

Active Member
Licensed User
Longtime User
Yes.
GameView.BitmapsData is a List. You can find the index of the BitmapData object, remove it and add it as the last item.

I looked at the contents of the GameView.BitmapData. It's a series of Rects and Bitmaps. I have no idea on how to find a specific object. Furthermore, wouldn't removing an object and adding it to the end of the list essentially put that object's depth at the top most level? I'm trying to put the object behind everything else

Cheers,

Sterling
 
Upvote 0

sterlingy

Active Member
Licensed User
Longtime User
I found a solution.

Since I know the index of the dynamic objects in the LIST, instead of adding new object to the end, I just InsertAt the beginning of the dynamic object in the LIST.

BINGO!

-Sterling
 
Upvote 0
Top