<?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: iPad: Correctly scaling to 2x..</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/4108</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 02:20:38 +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/4108" rel="self" type="application/rss+xml" />

		<item>
			<title>riq on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108/page/2#post-24966</link>
			<pubDate>Sat, 30 Jan 2010 16:45:21 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">24966@http://www.cocos2d-iphone.org/forum/</guid>
			<description><blockquote><p>
My suggestion is that we set a reference resolution to work in; so if you're targeting the iPad's native resolution but also want to run on the iphone, you'd do something like so:</p>
<p>[[CCDirector sharedDirector] setReferenceResolution:ccp(1024, 768)];<br />
...<br />
[mySprite setPosition:ccp(100,100)];
</p></blockquote>
<p>If I understood correctly the feature, I think it wouldn't work when the code is already resolution independent.</p>
<p>For example:<br />
<pre><code>[[CCDirector sharedDirector] setReferenceResolution:ccp(1024, 768)];

// I use this code in a lot of places
CGSize s = [[CCDirector sharedDirector] winSize];
...
[mySprite setPosition:ccp(s.width/2, s.height/2)];</code></pre>
<p>On the iPad it will place the sprite at  (512,768),<br />
but on the iPhone it will place the sprite at (120,80) (actually I don't know if I did the math correctly) and not at (240,160).</p>
<p>If people want the reference-resolution feature (this means loading bigger images in iPhone which might not always be possible since 2nd generation devices supports up to 1024x1024 textures while 3rd generation (and possible the iPad) supports up to 2048x2048 textures), I would be cheaper to scale down the game.</p>
<p>Something like this:</p>
<pre><code>scale factor =  device_resolution / reference_resolution;
[scene setScale:scale_factor];

// if you are scaling down the game, don&#39;t forget to generate mipmap images.</code></pre>
<p>IMHO, the game would look better if users have 2 different sets of images: high res images for ipad, low res images for iPhone.
</p></description>
		</item>
		<item>
			<title>mitchallen on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24903</link>
			<pubDate>Sat, 30 Jan 2010 00:40:26 +0000</pubDate>
			<dc:creator>mitchallen</dc:creator>
			<guid isPermaLink="false">24903@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Cool - I removed the hack from my post and just told people to get the latest release.
</p></description>
		</item>
		<item>
			<title>x0661t on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24900</link>
			<pubDate>Fri, 29 Jan 2010 23:37:02 +0000</pubDate>
			<dc:creator>x0661t</dc:creator>
			<guid isPermaLink="false">24900@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>riq,</p>
<p>thanks! you are doing a great job! thanks again!</p>
<p>P.S. i'm running any template, and it's still in 320x480, how can i run it in iPad resolution? Thanks!
</p></description>
		</item>
		<item>
			<title>riq on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24899</link>
			<pubDate>Fri, 29 Jan 2010 23:31:35 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">24899@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>x0661t: yes, sure.<br />
Please, see this thread:<br />
<a href="http://www.cocos2d-iphone.org/forum/topic/4145" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/4145</a>
</p></description>
		</item>
		<item>
			<title>x0661t on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24898</link>
			<pubDate>Fri, 29 Jan 2010 23:28:39 +0000</pubDate>
			<dc:creator>x0661t</dc:creator>
			<guid isPermaLink="false">24898@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>riq,</p>
<p>so, we can checkout svn?
</p></description>
		</item>
		<item>
			<title>riq on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24896</link>
			<pubDate>Fri, 29 Jan 2010 23:15:46 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">24896@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>SVN r1753 is resolution independent (iPad compatible): director, camera, effects, max texture size, (and even the tests) work on iPad in 1024x768.
</p></description>
		</item>
		<item>
			<title>Drunknbass on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24895</link>
			<pubDate>Fri, 29 Jan 2010 23:07:27 +0000</pubDate>
			<dc:creator>Drunknbass</dc:creator>
			<guid isPermaLink="false">24895@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>if its called over and over (like multiple times per second) id define a var to hold the cgsize, if not and its only called sometimes, it really doesnt matter.</p>
<p>and eoin.<br />
the if statement is necessary to set the correct size for the iPad if the screen size is detected to be that size, so you first set the size to iphone/ipod size and only change it if its an ipad. essentially the same as an if else but cleaner.
</p></description>
		</item>
		<item>
			<title>mitchallen on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24885</link>
			<pubDate>Fri, 29 Jan 2010 21:01:04 +0000</pubDate>
			<dc:creator>mitchallen</dc:creator>
			<guid isPermaLink="false">24885@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I was trying to do a quick local hack.  The problem is that this function is constantly being called.  Ideally you would want to do something like this:</p>
<p>	CGRect rect;<br />
	// Get screen dimensions<br />
	rect = [[UIScreen mainScreen] bounds];</p>
<p>and use rect.size.width, rect.size.height</p>
<p>But I don't think you would want to do this over and over here.  I haven't delved into the mechanics enough to know if the Director already sets these values to private variables initialized once on startup that can be accessed.  That would be ideal - and yeah, no #ifdefs.</p>
<p>But I figured there was no point in getting into a detailed solution since I'm sure one will be coming soon.
</p></description>
		</item>
		<item>
			<title>eoin on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24876</link>
			<pubDate>Fri, 29 Jan 2010 19:10:03 +0000</pubDate>
			<dc:creator>eoin</dc:creator>
			<guid isPermaLink="false">24876@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is the If statement even necessary. Why would w = frame.size.width/ 2, and h = frame.size.height /2  where frame was previously assigned [UIScreen bounds]?  Is the call to UIScreen bounds expensive?
</p></description>
		</item>
		<item>
			<title>Drunknbass on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24875</link>
			<pubDate>Fri, 29 Jan 2010 18:52:57 +0000</pubDate>
			<dc:creator>Drunknbass</dc:creator>
			<guid isPermaLink="false">24875@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>mitchallen why would use use an ifdef?</p>
<p>why not just use something like</p>
<p>        float w = 480 / 2;<br />
	float h = 320 / 2;</p>
<p>	if (CGRectEqualToRect([UIScreen mainScreen].bounds, CGRectMake(0, 0, 768, 1024))) {<br />
		w = 1024 / 2;<br />
		h = 768 / 2;<br />
	}
</p></description>
		</item>
		<item>
			<title>teedr on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24873</link>
			<pubDate>Fri, 29 Jan 2010 18:38:36 +0000</pubDate>
			<dc:creator>teedr</dc:creator>
			<guid isPermaLink="false">24873@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>There appears to be some reported bugs on poor FPS performance in the sim for 3.2</p>
<p><a href="https://devforums.apple.com/message/161171#161171" rel="nofollow">https://devforums.apple.com/message/161171#161171</a>
</p></description>
		</item>
		<item>
			<title>mitchallen on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24870</link>
			<pubDate>Fri, 29 Jan 2010 18:04:48 +0000</pubDate>
			<dc:creator>mitchallen</dc:creator>
			<guid isPermaLink="false">24870@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've posted a temp hack to get around the hard-coding in Director.m:  <a href="http://mitchallen.com/iphone/archives/506" rel="nofollow">http://mitchallen.com/iphone/archives/506</a> .  I tried it with code based on the Sprite demos and it seems to solve scaling on the iPad - at least in landscape mode.
</p></description>
		</item>
		<item>
			<title>Blue Ether on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24849</link>
			<pubDate>Fri, 29 Jan 2010 15:02:34 +0000</pubDate>
			<dc:creator>Blue Ether</dc:creator>
			<guid isPermaLink="false">24849@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I think the confusing issue here is that, as we all should know, the iPhone Simulator is useless for judging device performance of OpenGL.  It's not even attempting to emulate the hardware but merely rendering its own OpenGL as if it were a Mac application.</p>
<p>So, what to make of the slow performance in the iPad simulator?  On the surface, it seems ridiculous that our burly Macs can't handle something the little A4 supposedly can, optimized though it may be.  Than again, perhaps the simulator itself is also poorly optimized.</p>
<p>Without hearing something from Apple, its hard to be sure about what is going on.
</p></description>
		</item>
		<item>
			<title>graphG on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24843</link>
			<pubDate>Fri, 29 Jan 2010 14:30:13 +0000</pubDate>
			<dc:creator>graphG</dc:creator>
			<guid isPermaLink="false">24843@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/57254'>Blue</a> Ether thanks.</p>
<p>I guess at this stage we have to assume our games won't be graphics bound when upscaling to the bigger res. The A4 details seem a bit sparse at the moment. Riq, is there anything else to consider when scaling our games up to 1024x768?
</p></description>
		</item>
		<item>
			<title>Blue Ether on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24831</link>
			<pubDate>Fri, 29 Jan 2010 12:32:44 +0000</pubDate>
			<dc:creator>Blue Ether</dc:creator>
			<guid isPermaLink="false">24831@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have no performance issues on my MacBook running iPhone apps in compatibility mode at either 1x or 2x, for whatever that is worth.      But yes I do have problems when I start scaling everything up to fill the screen as a native iPad app.</p>
<p>@<a href='http://www.cocos2d-iphone.org/forum/profile/6095'>graphG</a>:  Max texture size in OpenGL ES 2.0 is 2048x2048.  The ratio of screen size to max texture size is now not quite as good as it is on iPhone, but it should be good enough.
</p></description>
		</item>
		<item>
			<title>graphG on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24829</link>
			<pubDate>Fri, 29 Jan 2010 10:56:57 +0000</pubDate>
			<dc:creator>graphG</dc:creator>
			<guid isPermaLink="false">24829@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/1293'>Drunknbass</a> yes I've compiled for iPad with the native screen size, and the performance is bad, 12-30 fps, where as the original app at the original resolution runs at 60fps on a gen 1 device.</p>
<p>As @ Barney said, I guess we have to keep the faith, and assume the new hardware can handle an increase in res without killing the framerate.</p>
<p>Does anyone know any specs on the GPU part of A4? i.e what is the maximum texture atlas we could use etc.... Sorry for the noob questions!
</p></description>
		</item>
		<item>
			<title>teedr on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24821</link>
			<pubDate>Fri, 29 Jan 2010 04:51:58 +0000</pubDate>
			<dc:creator>teedr</dc:creator>
			<guid isPermaLink="false">24821@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have right clicked on my target and select Transition. Then changed my active target to the -ipad version.</p>
<p>But when I go to run in the simulator, I get the error:<br />
"Failed to launch simulated application: Unknown error."</p>
<p>Am I missing something obvious?
</p></description>
		</item>
		<item>
			<title>Drunknbass on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24797</link>
			<pubDate>Fri, 29 Jan 2010 01:13:57 +0000</pubDate>
			<dc:creator>Drunknbass</dc:creator>
			<guid isPermaLink="false">24797@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>are all these tests(w/ bad performance) using iphone compiled apps scaled to 2x? has anyone tried a full ipad screen sized eglview and see if it still runs as poor?
</p></description>
		</item>
		<item>
			<title>graphG on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24771</link>
			<pubDate>Thu, 28 Jan 2010 22:53:34 +0000</pubDate>
			<dc:creator>graphG</dc:creator>
			<guid isPermaLink="false">24771@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi @<a href='http://www.cocos2d-iphone.org/forum/profile/276'>Barney</a></p>
<p>Yeah that's sensible, certainly seems the best way to approach this until we have a device to play with. Reports are coming in that the A4 is quite a monster so we should be cool!
</p></description>
		</item>
		<item>
			<title>Barney on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24767</link>
			<pubDate>Thu, 28 Jan 2010 22:06:38 +0000</pubDate>
			<dc:creator>Barney</dc:creator>
			<guid isPermaLink="false">24767@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/6095'>graphG</a>....Considering past release cycles we can probably expect some Game specific updates as it gets closer to launch.  I definitely encourage going into the forums or the bug reporting tool and providing feedback.</p>
<p>I think the most important thing for us in the interim is to make sure we have a good solid design and try not to deviate too far from the foundation laid in the current devices on the first go.</p>
<p>I'm hoping the device is going to at least be capable of scaling up the performance of the 3GS to the larger screen surface so most of our current games should be expected to function even if we ramp up the graphics quality accordingly.</p>
<p>The real question is how far we can go beyond that, but hey we're still talking Cocos2D so we should be okay.</p>
<p>Barney
</p></description>
		</item>
		<item>
			<title>graphG on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24762</link>
			<pubDate>Thu, 28 Jan 2010 21:21:47 +0000</pubDate>
			<dc:creator>graphG</dc:creator>
			<guid isPermaLink="false">24762@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/276'>Barney</a> interesting.... This is going to be crazy to get a game out for launch, if we can't test on the device how can we be sure it'll perform well!
</p></description>
		</item>
		<item>
			<title>Barney on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24756</link>
			<pubDate>Thu, 28 Jan 2010 21:02:25 +0000</pubDate>
			<dc:creator>Barney</dc:creator>
			<guid isPermaLink="false">24756@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm only getting about 24fps on a fairly beefy Mac Book Pro when I go to full resolution.  The fan runs like its about to about to spin off the axle.
</p></description>
		</item>
		<item>
			<title>graphG on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24750</link>
			<pubDate>Thu, 28 Jan 2010 20:27:10 +0000</pubDate>
			<dc:creator>graphG</dc:creator>
			<guid isPermaLink="false">24750@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Let me know how your performance is, I am having real issues getting my game to run above 30fps in the simulator, see my other post.
</p></description>
		</item>
		<item>
			<title>graphG on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24749</link>
			<pubDate>Thu, 28 Jan 2010 20:26:33 +0000</pubDate>
			<dc:creator>graphG</dc:creator>
			<guid isPermaLink="false">24749@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Right click on your target and select Transition. Then change your active target to the -ipad version...
</p></description>
		</item>
		<item>
			<title>danwar on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24747</link>
			<pubDate>Thu, 28 Jan 2010 20:18:09 +0000</pubDate>
			<dc:creator>danwar</dc:creator>
			<guid isPermaLink="false">24747@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Have you guys got your projects working well in the simulator?</p>
<p>I've transitioned my app and have an iPad specific target. When running it my app is simply being scaled to 1024x768, blurring everything... etc. I'm not seeing the behavior you describe nsxdavid ('with the graphics all in the lower left of the screen').</p>
<p>&#62; Correction, I think cocos2d DOES understand the bigger screen resolution... just that your app may or may not. :)</p>
<p>Any suggestions on how to take advantage of the extra space and have our apps run at true 1024x768? (Instead of 480x320 being scaled up to 1024x768).</p>
<p>Cheers,<br />
d.
</p></description>
		</item>
		<item>
			<title>nsxdavid on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24676</link>
			<pubDate>Thu, 28 Jan 2010 07:34:26 +0000</pubDate>
			<dc:creator>nsxdavid</dc:creator>
			<guid isPermaLink="false">24676@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Confirming... coscos2d seem ready for large screen resolutions out of the box!  NICE!
</p></description>
		</item>
		<item>
			<title>Billy Lavoie on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24646</link>
			<pubDate>Thu, 28 Jan 2010 04:50:53 +0000</pubDate>
			<dc:creator>Billy Lavoie</dc:creator>
			<guid isPermaLink="false">24646@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>yea, Cocos2d works fine with the extra real estate
</p></description>
		</item>
		<item>
			<title>nsxdavid on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24645</link>
			<pubDate>Thu, 28 Jan 2010 04:46:13 +0000</pubDate>
			<dc:creator>nsxdavid</dc:creator>
			<guid isPermaLink="false">24645@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Correction, I think cocos2d DOES understand the bigger screen resolution... just that your app may or may not. :)
</p></description>
		</item>
		<item>
			<title>nsxdavid on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24644</link>
			<pubDate>Thu, 28 Jan 2010 04:43:09 +0000</pubDate>
			<dc:creator>nsxdavid</dc:creator>
			<guid isPermaLink="false">24644@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Here's some tips:</p>
<p>Take your existing cocos2d project:</p>
<p>Find the target for it in the groups.  Right click and hit Transition.  It will create a new target (and some other things).</p>
<p>You can now build your app two ways:</p>
<p>EIther as an iPhone app that will work in the iPad simulator (with the 2X button)</p>
<p>Or as a native iPad app with the graphics all in the lower left of the screen (because cocos2d doesn't understand the iPad's screen resolution yet)</p>
<p>Switch between them by changing the active executable in the drop-down.</p>
<p>-- David
</p></description>
		</item>
		<item>
			<title>Blue Ether on "iPad: Correctly scaling to 2x.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4108#post-24623</link>
			<pubDate>Wed, 27 Jan 2010 22:30:25 +0000</pubDate>
			<dc:creator>Blue Ether</dc:creator>
			<guid isPermaLink="false">24623@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Sounds like a good start.</p>
<p>I'm interested if anyone else has managed to figure out how to toggle between 1x and 2x iPhone modes in the iPad Simulator?  Also, it appears as though the OpenGL viewport is not cropped or masked in any way.  Objects moving in from off-screen are visible!  It's quite hilarious and disappointing.  Not sure if this is just a Simulator issue though.  EDIT: Turns out this was because I wasn't building the project the correct way.  My bad.  Need to use Project/Transition to get things working right.</p>
<p>I'm somewhat concerned about the implications of the following statement for gaming apps:</p>
<p>'(New) An application’s interface should support all landscape and portrait orientations. This behavior differs slightly from the iPhone, where running in both portrait and landscape modes is not required. For more information, see “Designing for Multiple Orientations.”'</p>
<p>Hope there is some leeway for gaming apps here- otherwise yikes!
</p></description>
		</item>

	</channel>
</rss>

