Re: Card Game (like Spider-Solitaire) in Cocoa -- Conceptual ideas needed
Re: Card Game (like Spider-Solitaire) in Cocoa -- Conceptual ideas needed
- Subject: Re: Card Game (like Spider-Solitaire) in Cocoa -- Conceptual ideas needed
- From: Kyle Sluder <email@hidden>
- Date: Fri, 12 Jun 2009 11:19:31 -0700
On Thu, Jun 11, 2009 at 11:04 AM, Florian
Witteler<email@hidden> wrote:
> 1) Would you use interface-builder files to lay out all the things like
> - whole gametable with stacks of cards
> - stacks of cards
> - the card itself (background image and some icon with text)
> or would you handle all the drawing by yourself?
The typical, pre-Core Animation way of doing this would be to have a
large view for the game table (let's call it GameTableView), which
uses an instance of different cell classes to draw the different
things on the board. For example, in a poker game, there might be an
instance of CardCell and an instance of ChipCell.
Nowadays, we have Core Animation. Instead of drawing one cell
repeatedly, we tend to use multiple CALayers, either with delegates or
subclassed.
> 2) How would you handle the dragging of a card (and the cards, which lie on
> top of this card)?
Read up on NSEvent and tracking loops.
--Kyle Sluder
_______________________________________________
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