NSImage -> Jigsaw peices

Sage
Posts: 1,403
Joined: 2005.07
Post: #1
Hello, Im making a port of the origional jigsaw puzzle game that Mac used to have before someone didnt remake it for os x Mad

So does anyone know how to draw parts of an NSImage into a specific shape, to create the jigsaw peices, this isnt at all obvious to me...

thanks,

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 78
Joined: 2002.06
Post: #2
Something like:
Define a NSBezierPath in the shape of a Jigsaw piece
Save the clip path [gContext saveGraphicsState]
Use [jigsawPath addClip] to add it to the current clipping path
Then draw the image
Restore the clip path [gContext restoreGraphicsState]
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #3
You wanna make something like this.

"When you dream, there are no rules..."
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #4
willThimbleby: Works great thanks,
Taxxodium: No, a jigsaw

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #5
You could also play with the masking features in Tiger. Ofcourse that will limit your game to Tiger users, but saves you the trouble of programmatically drawing the jigsaw figure Smile

"When you dream, there are no rules..."
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #6
I dont have tiger Sad

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Basic NSImage drawing help please! xenocide 6 5,665 Feb 2, 2009 11:01 AM
Last Post: FlamingHairball
  NSImage and PNG's bmantzey 3 5,066 Nov 29, 2008 07:01 PM
Last Post: arekkusu
  Movie -> Jigsaw Pieces unknown 2 2,941 Nov 13, 2005 02:03 PM
Last Post: Volte
  NSImage PDF -> JPG unknown 3 3,918 Oct 23, 2005 08:36 PM
Last Post: PowerMacX
  How to get resolution of an NSImage or NSBitmapImageRep? aegidian 4 5,685 Oct 18, 2005 02:39 AM
Last Post: aegidian