LoginSignup
1
2

More than 5 years have passed since last update.

cocos2d-js でスプライトを奥に向かってくるくる回す

Posted at

RotateBy や RotateTo で回すんじゃなくて、奥に向かってくるくる回したいなと思って cc.orbitCamera を使って試してみた。

this.sprite = new cc.Sprite("/path/to/card.png");
this.sprite.attr({
    x: size.width / 2,
    y: size.height / 2
});
this.addChild(this.sprite, 0);

orbit = cc.orbitCamera(1.5, 1, 0, 0, 360, 0, 0);
this.sprite.runAction(orbit.repeatForever());

これで想像した通りの回転してる。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2