How to apply matrix transforms on cc2d sprite like css does?

How to apply matrix transforms on cc2d sprite like css does?
0.0 0


Hi all:

I have some matrix transform data what ported from swf resourses.
Is there any solutions to apply these transform data on cc2d sprite object like css does?
I’m a sheer newbie in cocos2d framework, but several years in HTML,CSS & Javascript.

There is a simple way to apply matrix transform like this by css:

-webkit-transform: matrix(0.456329345703125, 0.8898162841796875, -0.8898162841796875, 0.456329345703125, 100, 100);

but how do I do it on cc2d spirte?

var MyLayer = cc.Layer.extend({

    init:function () {

        var size = cc.Director.getInstance().getWinSize();
        var layerColor = cc.LayerColor.create(cc.c4b(0,0,0,255), size.width, size.height);
        this.addChild(layerColor, 1);

        var layer = new cc.Layer();
        this.addChild(layer, 2);

        var sprite;
        sprite = cc.Sprite.create(s_Block, cc.rect());
        sprite.setAnchorPoint(cc.p(0.5, 0.5));
//        how to apply matrix tranform here?
//        0.456329345703125, 0.8898162841796875, -0.8898162841796875, 0.456329345703125, 100, 100
        layer.addChild(sprite, 2);

        return true;

I checked some api such as setScale,setSkewX,setSkewY,setRotation & etc. and no idea.

Thanks for all ideas!