Seasons.NET

ちょっとした技術ブログです

cocos2d 1.0.0 rc3リリース&リリースノート翻訳

元記事
cocos2d 1.0.0rc3がリリースされました。

今回のハイライトは。

●Skew Transformations
 →スプライトのSkew(傾斜)変形に対応しました
●TextureCache debug information
 →TextureCacheのVRAM占有情報を出力できるようになりました
●Bug fixes
 →各種バグフィックス


さて、今までリリースされた1.0.0rc3までのリリースノートが
こちらから参照できますが
英語なので日本語に翻訳した内容をここに記します。



IMPORTANT(重要)
Base SDK 4.1 or newer should be used.

 ベースSDK 4.1以上を使ってください。

Don't report bugs if you are using a previous version.
Don't you have Base SDK 4.1 ? Install Xcode 3.2.6 or newer.
How to set Base SDK to 4.1: Xcode → Project → Edit project Settings → Build → Base SDK
Both Xcode 4 and Xcode 3 can be used with cocos2d.

前のバージョンを使っていてもバグレポートは出さないでください。
Base SDKがないって?Xcode 3.2.6をインストールしましょう。
Base SDK 4.1にする方法は、Xcode -> Project -> Edit project Settings -> Build -> Base SDKで設定します。
Xcode 4と3でcocos2dは利用できます。

Download
You can download cocos2d for iPhone v1.0.0-rc3 from here:

cocos2d-iphone-1.0.0-rc3.tar.gz

あなたは、cocos2d iPhone v1.0.0 rc3をダウンロードできます。


Document(ドキュメント)
You can find the v1.0.0 documentation here:

あなたは、v.1.0.0のドキュメントを参照することができます。

APIリファレンスv1.0.0
プログラミングガイド


Performance(パフォーマンス)

To understand how fast cocos2d v1.0.0 is, please see the performance tests

cocos2d v1.0.0がどれくらい速いか理解するには次のパフォーマンステストを見るとよいでしょう。

パフォーマンステスト


IMPORTANT : If you notice an slowdown while loading JPG images, see Issue #886

重要:もしJPGファイルの読み込みが遅い時は、Issue 886を参照してください。

追記:作者からコメントもらいました。
なぜそうなっているかというとJPG -> PNGに変換して対応しており、
修正ではなく対処したという理解をもってもらいたいそうです。


New Features / Improvements(新機能、改善)
Crash on Memory Warning
An important bug related to purging the texture cache data was fixed.

メモリーワーニング上でのクラッシュの問題
→Textureキャッシュの解放に関するバグを修正した。

All cocos2d users should use this version of apply this patch:

全てのcocos2dユーザーはこのパッチを当てて欲しい。

パッチの場所


Gradient Layer(グラデーションレイヤー)
Added support for “compressed interpolation”.

グラデーションレイヤー
"compressed interpolation"をサポートしました。

compressed interpolationをONにすると、開始と終了時の色がハッキリと表示される
グラデーションとなり、OFFの時はそうなりません=今まで通り。


どのように使うか?

[gradientLayer setCompressedInterpolation:NO];
[gradientLayer setCompressedInterpolation:YES]; // default value

// setCompressedInterpolationにBOOL値をセットして使います


LabelTTF(ラベル)
Added support for different line modes in CCLabelTTF

ラベルTTF
異なるラインモードを追加しました。

サポートされたのは次の3つです。
●CCLineBreakModeWordWrap (default one)
→単語単位で折り返す
●CCLineBreakModeCharacterWrap (not supported on Mac)
→単語の途中でも文字単位で折り返す
●CCLineBreakModeClip (not supported on Mac)
→指定した矩形に収まらない場合は表示されない

どのように使うか?

id label = [CCLabelTTF labelWithString:@"Hello World"
			    dimensions:CGSizeMake(s.width/4,40)
			     alignment:CCTextAlignmentCenter
			 lineBreakMode:CCLineBreakModeCharacterWrap
			      fontName:@"Marker Felt"
			      fontSize:16];

lineBreakModeにモードを指定して使います。

If you don't specify the linebreak mode, then it will use CCLineBreakModeWordWrap.

デフォルトでは、CCLineBreakModeWordWrapを使います。


Mac Improvements(Mac側の改善)


Added support for Touch events

Touch イベント追加

It is possible to create a GL view programatically

GL Viewをプログラマブルに生成可能に。

LabelTTF alignment works as expected

期待した通りにLabelTTFのアライメントが動作

Event Dispatchers works as expected

期待した通りにEventのディスパッチャが動作

NSTimer can be executed

NSTimerが実行できるようになりました

Templates works with Cocos Denshion

Cocos Denshionでテンプレートが動作

Added Xcode 4 templates both for Box2d and Chipmunk

Box2dとChipmunkのXcode 4テンプレート追加

Code is 64-bit friendly

64bit動作

Fullscreen reuses previous OpenGL view

フルスクリーンは前回のOpenGLViewを利用するようにした。


Skew support(傾斜サポート)
Added support for skew transformations:

スプライトに傾斜機能が追加されました。

どのように使うか?

sprite.skewX = 45.0f;
[sprite2 setSkewY: 32];

スプライトのskewプロパティに角度を設定します。


Added also the CCSkewBy and CCSkewTo actions:

アクションにも追加できます
eg:
id actionTo = [CCSkewTo actionWithDuration:2 skewX:37.2f skewY:-37.2f];
id actionBy = [CCSkewBy actionWithDuration:2 skewX:0.0f skewY:-90.0f];


Texture Cache(テクスチャキャッシュ)
Issue 1154
Add functionality for dumping CCTextureCache's texture list with VRAM memory estimates.

VRAMメモリの概算をCCTextureCacheリストとして出力できるようになりました。
Example:
[[CCTextureCache sharedTextureCache] dumpCachedTextureInfo];

CCTextureCacheのdumpCachedTexureInfoメソッドを呼び出すことでコンソールに出力されます。

出力例)
Texture2dTest[28679:207] cocos2d: "r2.png" rc=2 id=13 64 x 64 @ 32 bpp => 16 KB
Texture2dTest[28679:207] cocos2d: "b1.png" rc=2 id=10 128 x 64 @ 32 bpp => 64 KB
Texture2dTest[28679:207] cocos2d: "f1.png" rc=2 id=14 128 x 64 @ 32 bpp => 64 KB
Texture2dTest[28679:207] cocos2d: "b2.png" rc=2 id=11 128 x 64 @ 32 bpp => 64 KB
Texture2dTest[28679:207] cocos2d: "f2.png" rc=2 id=15 128 x 64 @ 32 bpp => 64 KB
Texture2dTest[28679:207] cocos2d: "test_image.tiff" rc=3 id=2 128 x 128 @ 32 bpp => 64 KB
Texture2dTest[28679:207] cocos2d: "r1.png" rc=2 id=12 64 x 64 @ 32 bpp => 16 KB
Texture2dTest[28679:207] cocos2d: CCTextureCache dumpDebugInfo: 7 textures, for 352 KB (0.34 MB)