Re: Touch-and-drag architecture question
Re: Touch-and-drag architecture question
- Subject: Re: Touch-and-drag architecture question
- From: Jens Alfke <email@hidden>
- Date: Sun, 14 Feb 2010 14:18:17 -0800
CoreAnimation is the best way to go for board games IMO. Lighter
weight than views, and it does the interpolation for you.
I wrote a framework for board games using CA:
http://bitbucket.org/snej/geekgameboard
--Jens {via iPhone}
On Feb 14, 2010, at 1:38 PM, Dave DeLong <email@hidden> wrote:
Hi everyone,
I've an iPhone app that I'm working on (it's a simple game), where
I've got the game board on the screen, and then a row of pieces
above and below the board (representing the pieces controlled/
captured by each player). I'd like to be able to drag pieces from
these rows onto the board. My question is this:
How should I set up the view hierarchy to do the drag and drop? As
I see it, there are three main ways:
1. Use different views for the board and the two rows. This is
good for encapsulation, but bad for cross-view dragging.
2. Use a single view for the board and the two rows. This is bad
for encapsulation, but makes dragging much easier.
3. Use different views for the board and the two rows, but have an
invisible view on top of everything that captures all the events and
passes them on accordingly. I'm not sure how this would work out.
Perhaps another important question is: how should pieces be
rendered? I've been drawing them with CoreGraphics (hence the
difficulty of dragging them between views), but I could also make
each piece its own UIView (which might complicate dragging in other
ways).
What do you suggest?
Thanks!
Dave DeLong
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden