m_gundong: cc.Label,
m_zhezhao: cc.Mask
gundongText: function() {
var self = this;
setTimeout(function() {
// var notifyRes = JSON.parse(cc.sys.localStorage.getItem('notify'));
var notifyRes =
'只有预制节点 "gameRules" 及其子节点会被保存。只有预制节点 "gameRules" 及其子节点会被保存。';
var gundongNode = cc.find("Canvas/m_gundong");
if (notifyRes != null) {
if (gundongNode) {
gundongNode.active = true;
}
self.m_gundong.string = notifyRes;
} else {
if (gundongNode) {
gundongNode.active = false;
}
}
var text = self.m_gundong;
var width = self.m_zhezhao.node.width;
cc.log(width);
text.node.runAction(
cc.repeatForever(
cc.sequence(
cc.moveTo(
(text.node.width / width) * 10,
cc.v2(-text.node.width - width / 5, text.node.y)
),
cc.callFunc(function() {
text.node.x = width;
})
)
)
);
}, 300);
https://www.jianshu.com/p/5ea37a801603