cocos2d / cocos2d-html5

Cocos2d for Web Browsers. Built using JavaScript.
https://www.cocos.com
3.06k stars 902 forks source link

setAdditionalTransform could not work in browser #3389

Open samael65535 opened 8 years ago

samael65535 commented 8 years ago

Native is OK

ntrrgc commented 8 years ago

Could you elaborate? I've used it in browser just fine.

samael65535 commented 8 years ago

cocos 3.12

        var player1 = new cc.Sprite("res/player.jpg");
        player1.x = cc.winSize.width / 2;
        player1.y = cc.winSize.height / 2;
        this.addChild(player1);

        var player2 = new cc.Sprite("res/player.jpg");
        player2.setAdditionalTransform(player1.getNodeToParentTransform());
        this.addChild(player2);