zoukankan      html  css  js  c++  java
  • quick cocos 的scheduler 定时器

    cocos2dx原生lua对于定时器的写法:

    1.每帧调用:

    void scheduleUpdateWithPriority(int priority) 

    void scheduleUpdateWithPriorityLua (int nHandler,int priority)

    2.指定调用间隔时间的:

    unsigned int scheduleScriptFunc (unsigned int nHandler, float fInterval, bool bPaused)

    3.取消定时器事件

    void unscheduleScriptEntry (unsigned int uScheduleScriptEntryID)

    quick对于schedule的调用:

    首先引入这个模块,

    local scheduler=require("framework.scheduler")

    1.每帧调用:

    scheduler.scheduleUpdateGlobal(onInterval)

    2.指定调用间隔时间的:

    scheduler.scheduleGlobal(onInterval, time)

    scheduler.performWithDelayGlobal(onInterval, time)

    3.取消定时器事件

    scheduler.unscheduleGlobal(handler)

    cocos2dx c++ schedule:

    scheduleUpdate() ->update(float dt)

    schedule(schedule_selector(handler),time)

  • 相关阅读:
    软件工程个人作业01
    动手动脑
    大道至简感想终结篇
    课后作业
    反思
    课后作业
    不忘初心,方得始终
    课后作业
    沟通,让一切变得简单

  • 原文地址:https://www.cnblogs.com/zhangligopher/p/4037577.html
Copyright © 2011-2022 走看看