1

これは、Stack Overflow での最初の質問です。

Cocos2d で骨格アニメーションをいじっています。TheDamArmada / Flash2Cocos2D ライブラリを使用することで、CCSprite から継承した FTCCharacter を初期化できます。を使用してキャラクター全体を反転しようとしましたmyRobot.flipX = YESが、うまくいきません。

なにか提案を?

これはFlash2Cocos2Dへのインライン リンクです。

ありがとう。

4

1 に答える 1

0

Cocos2D ソースから (CCSprite.h:121)

/** whether or not the sprite is flipped horizontally.
 It only flips the texture of the sprite, and not the texture of the sprite's children.
 Also, flipping the texture doesn't alter the anchorPoint.
 If you want to flip the anchorPoint too, and/or to flip the children too use:

    sprite.scaleX *= -1;
 */
@property (nonatomic,readwrite) BOOL flipX;

したがって、FTCCharacter の子は反転されないことが予想されます。 myRobot.scaleX *= -1;Cocos2D の提案どおりに動作するはずです。

于 2012-09-30T04:31:47.213 に答える