SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
14.
同一画像による複数スプライト
this._super();
//画面サイズ取得
var size = cc.winSize;
//50個のリンゴを表示
for (var i = 0; i < 50; i++) {
var x = cc.random0To1() * 960;
var y = cc.random0To1() * 640;
var apple = new cc.Sprite(res.Apple_png);
apple.setPosition(x, y);
this.addChild(apple);
}
return true;
46.
非同期読み込みによる描画
loadingCallback:function (texture) {
//画面サイズ取得
var size = cc.winSize;
//画像の表示
var x = cc.random0To1() * 960;
var y = cc.random0To1() * 640;
var sprite = new cc.Sprite(texture);
sprite.setPosition(x, y);
this.addChild(sprite);
}