我完全陷入困惑。蘋果告訴說,在iPhone 4中,人們可以使用高分辨率的圖像... 比標準的一個。所以我使用2圖像([email protected]和image.png)...iPhone 4圖像分辨率和圖像尺寸
[email protected] has 50 * 50尺寸和分辨率72 image.png具有25 *比當我運行的代碼
UIImage *image = [ UIImage imageNamed:@"a.png"];
CCTexture2D *tex = [ [CCTexture2D alloc] initWithImage:image ];
[image release];
CCSprite *u = [CCSprite spriteWithTexture:tex rect:CGRectMake(0, 0,25, 25)];
在iPhone 4我認爲[email protected]應加載25維和72
分辨率和它加載但圖像被剪切...我沒有得到完整的圖像......
但是當我藉此...
[email protected]有25 * 25的尺寸和分辨率144 image.png有25 * 25的尺寸和分辨率72
圖像沒有削減和所有好吧......不知道爲什麼?
另一件事....當我使用這個..
UIImageView *imageView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"BGS.png"]];
[self.view addSubview:imageView];
[imageView release];
它的工作原理像蘋果說....然後是它的cocos2d的概率?我正在使用cocos2d.99.4 ..
請添加單位,25px,25pt,144px/in。 Btw。 iPhone 4的分辨率是:326px/in,但是163pt/in,iPhone 3G和iPhone 3GS的分辨率是163px/in和163pt/in。 – Thomas 2010-08-13 05:27:03