iPhone CALayer constraint question

Nibbie
Posts: 3
Joined: 2009.06
Post: #1
Hey all,

I'm currently designing a game using Core Animation layers--I have a gameboard sitting on one CALayer, with each game piece occupying a sub-CALayer.

When the program initializes, it places the sub-CALayers within its bounds--the problem is that the iPhone SDK doesn't provide support for a layoutManager, like Cocoa does.

I'm looking for a way to define constraints on the sub-CALayers with respect to a super-CALayer, without using a constraint manager. I basically don't want the sublayers to leave the bounds of the constraining layer. Does anyone know of a way to make this happen? Am I going to have to constantly compare coordinates, and just tell the sub-CALayer not to redraw if it moves outside the bounds?

Any ideas would be appreciated!

Thanks all,
~Sam
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Question about animation in an iPhone game stansoft 7 10,146 Oct 4, 2011 04:55 AM
Last Post: Neison