CustomTips.js 590 B

1234567891011121314151617181920
  1. //CustomTips.js
  2. cc.Class({
  3. extends: cc.BaseClass,
  4. properties: {
  5. m_BGNode:cc.Node,
  6. m_LabNode:cc.Label,
  7. },
  8. start:function () {
  9. this.node.setPosition(0,-(window.SCENE_HEIGHT/2));
  10. var act = cc.sequence(cc.moveTo(0.2, cc.v2(0, 0)), cc.delayTime(0.8));
  11. this.node.runAction(cc.sequence(act,cc.callFunc( this.OnDestroy,this,this)));
  12. this.m_LabNode.string = this.m_strTips;
  13. this.m_BGNode.height = this.m_LabNode.node.height + 20;
  14. },
  15. SetTips:function(str){
  16. this.m_strTips = str;
  17. },
  18. });