Image Hierarchy in Interface Builder

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

I'm currently programming a sliding block puzzle, and am having a bit of trouble finding any specific layering attribute for an image.

For example, if I have a gameboard and a series of pieces, how do I tell Interface Builder that I want the pieces to always appear above the gameboard, and never below? Is this something I can take care of with Quartz, or should I look into OpenGL?

Thanks so much,

~Sam
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #2
I have about 4 different responses to this. It's hard to pick one so I'll just kinda jumble them.


The primary way Cocoa handles layering is parent/child via superview/subview. Leopard added some control over the draw order of sibling views.

You could use separate views for your game, but I wouldn't. <Insert reasons here>

A simple sliding puzzle like yours, can easily be done in a single view using Quartz, Core Animation with multiple layers, or OpenGL.

Any of them is capable for this, but I'd go probably with Core Animation layers. You could use OpenGL if you wanted, but you certainly don't need to.


There's my non-answer answer.
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2009.06
Post: #3
Seth, thanks for the note, I decided to go with Core Animation with multiple layers for this one. It's working pretty well--I'm having some trouble constraining the sub-CALayers with respect to the gameboard CALayer, since I can't implement a layoutManager on the iPhone, but I'm slowly hacking away at this issue.

Cheers,

~Sam Ritchie
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Adding NSOpenGLView class in Xcode/Interface Builder 3.0 Graphic Ace 2 3,653 Dec 5, 2007 02:15 PM
Last Post: Blacktiger
  Hierarchy, gluProject and collision detection lemtoo 3 4,647 Nov 30, 2007 09:26 AM
Last Post: lemtoo