Cocos2dx <Basic> Core Concepts(3)

<Schedule: loop frame>---> Provides a loop function in a node that is called by the system every frame

a. Call the update() function every frame:

     scheduleUpdate()

     Frames: Time per frame.

     dalta: The time difference exceeds the number of frames, which will cause lag. Do not write initialization work in update().

     unscheduleUpdate(): stop the update function

b. Loop function written by yourself

     schedule(schedule_selector(class name::member function))

     Stop the loop function you wrote yourself

     unschedule(schedule_selector(class name::member function))

c. Write your own loop function and set the number of frames

     void schedule(schedule_selector(class name::member function), float interval);

d. Write your own loop function, and set the number of frames, how many times to end the loop, and how long to execute the loop function

     void schedule(schedule_selector(class name::member function),, float interval, unsigned int repeat, float delay);

     

--------------------------------------------------------------------------------------

(1) Scenario: Container for storage layer

(2) Layer : Container. a. Handling touches (introduced later) b. Colored layers (in the game topic)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325607468&siteId=291194637