• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GeekGameBoard (was: Re: Touch-and-drag architecture question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GeekGameBoard (was: Re: Touch-and-drag architecture question)


  • Subject: Re: GeekGameBoard (was: Re: Touch-and-drag architecture question)
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 15 Feb 2010 09:36:34 -0800

On Feb 15, 2010, at 8:49 AM, Dave DeLong wrote:

> As far as GGB goes, how well does it handle custom boards?  For example, let's say I wanted to recreate this board: http://gallery.me.com/davedelong#100084/Board&bgcolor=black (dots are valid positions, and lines indicate valid moves between positions).
> Presumably I'd be creating a custom "Grid" subclass and building the board layout in there.  My board is based on a square grid, but I'm not sure how I'd only make some of the grid positions valid locations, nor how I'd draw the lines in between them. What would I need to do to recreate this board?

You can create a 7x7 RectGrid and then call -removeCellAtRow:column: to remove the cells that don't appear in that board. You'd also want to set the borderWidth to 0 in the remaining cells so they don't draw their square outlines.

Alternatively, you could just start with an empty board and add a BitHolder object for every valid position.

Drawing the background lines is up to you. You could create a fancy image of the board and add it as a PNG file, or you could make a CALayer for the background that has a custom drawing callback.

—Jens_______________________________________________

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

References: 
 >Touch-and-drag architecture question (From: Dave DeLong <email@hidden>)
 >Re: Touch-and-drag architecture question (From: Jens Alfke <email@hidden>)
 >GeekGameBoard (was: Re: Touch-and-drag architecture question) (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: Question about zipping files
  • Next by Date: Re: Bind to string (path), convert to NSImage
  • Previous by thread: GeekGameBoard (was: Re: Touch-and-drag architecture question)
  • Next by thread: NSBrowser Question
  • Index(es):
    • Date
    • Thread