<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Topic: iJig released on the App Store + Promo Code</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/1911</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 01:47:55 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/topic/1911" rel="self" type="application/rss+xml" />

		<item>
			<title>codecowboy on "iJig released on the App Store + Promo Code"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1911#post-29518</link>
			<pubDate>Wed, 10 Mar 2010 13:45:20 +0000</pubDate>
			<dc:creator>codecowboy</dc:creator>
			<guid isPermaLink="false">29518@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p><a href="http://www.cocos2d-iphone.org/archives/47" rel="nofollow">http://www.cocos2d-iphone.org/archives/47</a></p>
<p>this seems to be a good explanation.
</p></description>
		</item>
		<item>
			<title>codecowboy on "iJig released on the App Store + Promo Code"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1911#post-29515</link>
			<pubDate>Wed, 10 Mar 2010 13:01:38 +0000</pubDate>
			<dc:creator>codecowboy</dc:creator>
			<guid isPermaLink="false">29515@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks - only just found the reply. Do you know of a good explanation of sprites v Atlas textures? I can't find one.
</p></description>
		</item>
		<item>
			<title>vitoralmeidasilva on "iJig released on the App Store + Promo Code"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1911#post-28375</link>
			<pubDate>Mon, 01 Mar 2010 14:03:41 +0000</pubDate>
			<dc:creator>vitoralmeidasilva</dc:creator>
			<guid isPermaLink="false">28375@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi codecowboy.</p>
<p>Sure: I used a technique much like yours: An image mask with multiple copies of the image.</p>
<p>It works like this:</p>
<p> - I have 1 CGImageRef which is the full image (320x480), transparency included<br />
 - 1 mask (CGImageRef) (black&#38;white image with no transparency).<br />
 - Of course: each piece knows its coordinates from our full image</p>
<p>Some piece of code from the game (this is used on each piece):</p>
<p>[code]<br />
            // creates a uiimage (variable pieceImage) representing our piece (without the mask yet) from our photo<br />
            pieceRef = CGImageCreateWithImageInRect(photoRef, pieceRect);</p>
<p>            // creates a uiimage (variable imageMask) representing the mask that will be applied to our piece<br />
            maskRef		= CGImageCreateWithImageInRect(imageMaskRef, maskRect);</p>
<p>            // creates a uiimage (pieceImageMask) with our final piece image (already masked)<br />
            pieceImageMask = [ImageUtils maskImageRef:pieceRef withMask:maskRef];</p>
<p>            if (pieceRef == NULL &#124;&#124; maskRef == NULL) {<br />
                Sys_Error("invalid reference to pieceRef or maskRef");<br />
            }</p>
<p>            // create the jigsaw piece with the new image<br />
            piece = [JigsawPiece spriteWithCGImage:pieceImageMask]; // masked piece<br />
[/code]</p>
<p>The secret is the "ImageUtils maskImageRef" which gets the image and mask, returning a new image masked, using the function below:</p>
<p>[code]<br />
+ (CGImageRef)maskImageRef:(CGImageRef)image withMask:(CGImageRef)maskImage {<br />
    CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskImage), CGImageGetHeight(maskImage), CGImageGetBitsPerComponent(maskImage), CGImageGetBitsPerPixel(maskImage), CGImageGetBytesPerRow(maskImage), CGImageGetDataProvider(maskImage), NULL, false);<br />
    CGImageRef masked = CGImageCreateWithMask(image, mask); // the owner releases the image<br />
	CGImageRelease(mask);</p>
<p>    return masked;<br />
}<br />
[/code]</p>
<p>It has drawbacks:</p>
<p> - it is a little slow</p>
<p>If would develop it again I would probably use a AtlasSprite.</p>
<p>You can take a look at this site: <a href="http://iphonedevelopertips.com/cocoa/how-to-mask-an-image.html" rel="nofollow">http://iphonedevelopertips.com/cocoa/how-to-mask-an-image.html</a></p>
<p>Well, thats all.
</p></description>
		</item>
		<item>
			<title>codecowboy on "iJig released on the App Store + Promo Code"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1911#post-28373</link>
			<pubDate>Mon, 01 Mar 2010 13:45:55 +0000</pubDate>
			<dc:creator>codecowboy</dc:creator>
			<guid isPermaLink="false">28373@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>Could you share the technique you used for dynamic texture generation for sprites? I would like to do something similar and there seem to be a few different options.</p>
<p>Previously, in a flash environment, I used masks and multiple copies of the image so that each sprite or 'movieclip' (in the flash world) allowed the correct part of the image to show through.</p>
<p>thanks!
</p></description>
		</item>
		<item>
			<title>vitoralmeidasilva on "iJig released on the App Store + Promo Code"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1911#post-11917</link>
			<pubDate>Wed, 16 Sep 2009 14:49:47 +0000</pubDate>
			<dc:creator>vitoralmeidasilva</dc:creator>
			<guid isPermaLink="false">11917@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Greetings,</p>
<p>Finally our first game is released on the App Store: iJig a jigsaw game made with Cocos 2d (v 0.71). Focused on gameplay (I tested nearly every jigsaw game available on the App Store and none is as fluid as iJig is :)).</p>
<p>Promotional video:<br />
<a href="http://www.youtube.com/watch?v=CzgO6NXXpiY" rel="nofollow">http://www.youtube.com/watch?v=CzgO6NXXpiY</a></p>
<p>Here are some images:<br />
<img src="http://myplaymobile.com/wp-content/gallery/games-ijig/img_0022.png" /><br />
<img src="http://myplaymobile.com/wp-content/gallery/games-ijig/img_0023.png" /><br />
<img src="http://myplaymobile.com/wp-content/gallery/games-ijig/img_0024.png" /><br />
<img src="http://myplaymobile.com/wp-content/gallery/games-ijig/img_0018.png" /><br />
<img src="http://myplaymobile.com/wp-content/gallery/games-ijig/img_0020.png" /></p>
<p>Link on the App Store: <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=327595264&#038;mt=8" rel="nofollow">http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=327595264&#038;mt=8</a></p>
<p>The game was kind of a learning experience (it could be better but I think it is pretty fun as it is now). And I learned some lessons about the App Store: competition is hard (the App Store is crowded is some genres (jigsaw included) but there is SO MUCH SPACE for creative and inovative games).</p>
<p>Cocos 2d helped a lot, without it I would not have finished the game.</p>
<p>On the tech side: the game can use images from the camera or photo album (I used cocos with UIKit integration). Each piece is a sprite (not atlassprite) with a texture generated dynamically.</p>
<p>And of course: Sapus Tongue source code saved the day.</p>
<p>More info at: <a href="http://myplaymobile.com/games/ijig" rel="nofollow">http://myplaymobile.com/games/ijig</a></p>
<p>And here is one promo-code (more coming): 4KR73XWMRAJ4</p>
<p>Sheers.
</p></description>
		</item>

	</channel>
</rss>

