一、MarkDown的使用
signout: function (msg, data) {
this.signOutClear();
var ask = new hope.AskDialog(msg.promptTips, this._doRelogin, this);
ask.setIsBgShow(true)
ask.setOKInfo("重新连接");
ask.setTitle("提示")
ask.hideCancel();
},
var Hero = cc.Sprite.extend({
_hp:null,
_mp:null,
ctor: function(hp,mp){
this._super(“res/box.png”);
this.initData(hp,mp);
},
initData: function(hp,mp){
this._hp = hp;
this._mp = mp;
},
unuse: function(){
this._hp = 0; //属性清空
this._mp = 0;
this.retain(); //保存 防止被回收
this.removeFromParent();
},
reuse: function(hp,mp){
this.initData(hp,mp);
}
});
本文介绍了一个基于CCSprite的游戏角色实现方法及其状态管理,同时展示了如何利用自定义的AskDialog组件来处理用户交互,包括提示信息显示及重新连接等功能。
500

被折叠的 条评论
为什么被折叠?



