mirror of
https://github.com/photonstorm/phaser
synced 2024-12-22 19:13:37 +00:00
1 line
16 KiB
JSON
1 line
16 KiB
JSON
|
{"class":{"name":"Phaser.Timer","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":" A reference to the currently running game.","optional":false,"default":null},{"name":"autoDestroy","type":["boolean"],"help":"A Timer that is set to automatically destroy itself will do so after all of its events have been dispatched (assuming no looping events).","optional":true,"default":"true"}],"help":"A Timer is a way to create small re-usable or disposable objects that do nothing but wait for a specific moment in time, and then dispatch an event.\\nYou can add as many events to a Timer as you like, each with their own delays. A Timer uses milliseconds as its unit of time. There are 1000 ms in 1 second.\\nSo if you want to fire an event every quarter of a second you'd need to set the delay to 250."},"consts":[{"name":"HALF","type":"number","help":"","line":159},{"name":"MINUTE","type":"number","help":"","line":147},{"name":"QUARTER","type":"number","help":"","line":165},{"name":"SECOND","type":"number","help":"","line":153}],"methods":{"public":[{"name":"add","static":false,"returns":{"types":["Phaser.TimerEvent"],"help":"The Phaser.TimerEvent object that was created."},"help":"Adds a new Event to this Timer. The event will fire after the given amount of 'delay' in milliseconds has passed, once the Timer has started running.\\nCall Timer.start() once you have added all of the Events you require for this Timer. The delay is in relation to when the Timer starts, not the time it was added.\\nIf the Timer is already running the delay will be calculated based on the timers current time.","line":220,"public":true,"protected":false,"private":false,"parameters":[{"name":"delay","type":["number"],"help":"The number of milliseconds that should elapse before the Timer will call the given callback.","optional":false,"default":null},{"name":"callback","type":["function"],"help":"The callback that will be called when the Timer event occurs.","optional":false,"default":null},{"name":"callbackContext","type":["object"],"help":"The context in which the callback will be called.","optional":false,"default":null},{"name":"arguments","type":["any"],"help":"The values to be sent to your callback function when it is called.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"adjustEvents","static":false,"returns":null,"help":"Adjusts the time of all pending events and the nextTick by the given baseTime.","line":526,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"clearPendingEvents","static":false,"returns":null,"help":"Clears any events from the Timer which have pendingDelete set to true and then resets the private _len and _i values.","line":367,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Destroys this Timer. Any pending Events are not dispatched.\\nThe onComplete callbacks won't be called.","line":620,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"loop","static":false,"returns":{"types":["Phaser.TimerEvent"],"help":"The Phaser.TimerEvent object that was created."},"help":"Adds a new looped Event to this Timer that will repeat forever or until the Timer is stopped.\\nThe event will fire after the given amount of 'delay' milliseconds has passed once the Timer has started running.\\nCall Timer.start() once you have added all of the Events you require for this Timer. The delay is in relation to when the Timer starts, not the time it was added.\\nIf the Timer is already running the delay will be calculated based on the timers current time.","line":259,"public":true,"protected":false,"private":false,"parameters":[{"name":"delay","type":["number"],"help":"The number of milliseconds that should elapse before the Timer will call the given callback.","optional":false,"default":null},{"name":"callback","type":["function"],"help":"The callback
|