cocos2d-htm5使用cocostudio 动画

var s_Cowboy_json = "res/Cowboy.ExportJson";
var s_Cowboy_plist = "res/Cowboy0.plist";
var s_Cowboy_png = "res/Cowboy0.png";
var s_Dragon_xml = "res/Dragon.xml";
var s_Dragon_png= "res/Dragon.png";
var s_Dragon_plist = "res/Dragon.plist";

var g_resources = [
    //image

    {src:s_Cowboy_json},
    {src:s_Cowboy_plist},
    {src:s_Cowboy_png},

    {src:s_Dragon_plist},
    {src:s_Dragon_xml},
    {src:s_Dragon_png}
    //plist

    //fnt

    //tmx

    //bgm

    //effect
];
       var size = cc.Director.getInstance().getWinSize();
        /////////////////////////////
        // 2. add a menu item with "X" image, which is clicked to quit the program
        //    you may modify it.
        // ask director the window size
        // remove sigle resource
        ccs.ArmatureDataManager.getInstance().addArmatureFileInfo(s_Dragon_png, s_Dragon_plist, s_Dragon_xml);
        var armature = ccs.Armature.create("Dragon");
        armature.getAnimation().playWithIndex(0);
        armature.getAnimation().setSpeedScale(0.4);
        armature.setScale(0.6);
        armature.setAnchorPoint(0.5, 0.5);
        armature.setPosition(size.width / 2, size.height / 2);
        this.addChild(armature);



        ccs.ArmatureDataManager.getInstance().addArmatureFileInfo(s_Cowboy_json);
        var armature2 = ccs.Armature.create("Cowboy");
        armature2.getAnimation().play("Fire");
        armature2.setScale(0.2);
        armature2.setAnchorPoint(0.5, 0.5);
        armature2.setPosition(size.width / 2, size.height / 2);
        this.addChild(armature2);


你可能感兴趣的:(cocos2d-htm5使用cocostudio 动画)