The implementation of ScaleButton is based on javascript and typescript code - copy and use

call method

    newChestInstance(sp:cc.SpriteFrame,pos:cc.Vec3){
        var node = new cc.Node("New Sprite");
        var sprite = node.addComponent(cc.Sprite);
        node.parent = this.canvasRoot;
        sprite.spriteFrame = sp;

        sprite.node.position = pos;

        node.addComponent(ChestView);
    }

In fact, it really doesn’t matter which platform or language you use for development.

The following code, when started, can even be traced back to the Laya platform. After passing the cocos test, the code can be used directly.

  // Laya.Tween.clearTween(this._btn);
 // Laya.Tween.to(this._btn, { scaleX: this._s_ScaleX * this._t_ScaleX, scaleY: 

Complete ScaleButton code


/*
一个普通的ScaleButton实现,暂时cocos平台

另外, Chest 的边缘发光,点击后高亮,参考自:
https://forum.cocos

Guess you like

Origin blog.csdn.net/avi9111/article/details/133910121