美文网首页
LayaBox:使用setTimeOut()定时执行不生效

LayaBox:使用setTimeOut()定时执行不生效

作者: 一眼就认出你 | 来源:发表于2018-10-10 21:24 被阅读0次

    成功的延时执行代码:

    Laya.timer.once(1000, this, this.sendAdvance);
    

    解释:
    sendAdvance();是展示延时执行的某些动画效果
    比如:一张图片,每隔一段时间就向右移动20个像素

    失败的延时代码:

    setTimeOut(this.sendAdvance,1000);
    

    效果是:一下子就移动过去,没有停顿

    有哪位大佬可以解答吗??

    相关文章

      网友评论

          本文标题:LayaBox:使用setTimeOut()定时执行不生效

          本文链接:https://www.haomeiwen.com/subject/chimaftx.html