Depth Sorting

Nibbie
Posts: 1
Joined: 2010.10
Post: #1
Hi,

I'm new to iPhone game development and have a question related to depth sorting.

Basically I'm developing a 2D game which requires using the z-axis. The game is an isometric game with multiple objects on screen..some further away in distance and some nearer. The objects keep shifting in their z-axis, so objects which are behind come in front and objects which are in front go behind. This requires depth sorting of objects.

I have been suggested to use UIImageViews in my game, and to modify the layering of the UIImageview in order to sort out depth issue.

I have tried using insert subview method to change the layering of the UIImageView object but no luck.

Is there another way to work with depth sorting.

Thanks,
Quote this message in a reply
Member
Posts: 50
Joined: 2002.12
Post: #2
If you are using UIImageView, simply do this.

Code:
myImageView.layer.zPosition = 10;

The higher numbers will be drawn on top.

stinware.com where games are friends.
Quote this message in a reply
Post Reply