phaser/2.7.0/resources/docgen/output/Phaser.Timer.json
2016-11-22 01:36:56 +00:00

1 line
No EOL
16 KiB
JSON
Executable file

{"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 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":"order","static":false,"returns":null,"help":"Orders the events on this Timer so they are in tick order. This is called automatically when new events are created.","line":330,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"pause","static":false,"returns":null,"help":"Pauses the Timer and all events in the queue.","line":483,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"remove","static":false,"returns":null,"help":"Removes a pending TimerEvent from the queue.","line":311,"public":true,"protected":false,"private":false,"parameters":[{"name":"event","type":["Phaser.TimerEvent"],"help":"The event to remove from the queue.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"removeAll","static":false,"returns":null,"help":"Removes all Events from this Timer and all callbacks linked to onComplete, but leaves the Timer running.\\nThe onComplete callbacks won't be called.","line":605,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"repeat","static":false,"returns":{"types":["Phaser.TimerEvent"],"help":"The Phaser.TimerEvent object that was created."},"help":"Adds a new TimerEvent that will always play through once and then repeat for the given number of iterations.\\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":240,"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":"repeatCount","type":["number"],"help":"The number of times the event will repeat once is has finished playback. A repeatCount of 1 means it will repeat itself once, playing the event twice in total.","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":"resume","static":false,"returns":null,"help":"Resumes the Timer and updates all pending events.","line":563,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"start","static":false,"returns":null,"help":"Starts this Timer running.","line":270,"public":true,"protected":false,"private":false,"parameters":[{"name":"delay","type":["number"],"help":"The number of milliseconds that should elapse before the Timer will start.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""},{"name":"stop","static":false,"returns":null,"help":"Stops this Timer from running. Does not cause it to be destroyed if autoDestroy is set to true.","line":293,"public":true,"protected":false,"private":false,"parameters":[{"name":"clearEvents","type":["boolean"],"help":"If true all the events in Timer will be cleared, otherwise they will remain.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"sortHandler","static":false,"returns":null,"help":"Sort handler used by Phaser.Timer.order.","line":347,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"update","static":false,"returns":{"types":["boolean"],"help":"True if there are still events waiting to be dispatched, otherwise false if this Timer can be destroyed."},"help":"The main Timer update event, called automatically by Phaser.Time.update.","line":392,"public":false,"protected":true,"private":false,"parameters":[{"name":"time","type":["number"],"help":"The time from the core game clock.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"private":[{"name":"_pause","static":false,"returns":null,"help":"This is called by the core Game loop. Do not call it directly, instead use Timer.pause.","line":508,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"_resume","static":false,"returns":null,"help":"This is called by the core Game loop. Do not call it directly, instead use Timer.pause.","line":586,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"create","static":false,"returns":{"types":["Phaser.TimerEvent"],"help":"The Phaser.TimerEvent object that was created."},"help":"Creates a new TimerEvent on this Timer. Use the methods add, repeat or loop instead of this.","line":181,"public":false,"protected":false,"private":true,"parameters":[{"name":"delay","type":["number"],"help":"The number of milliseconds that should elapse before the Timer will call the given callback. This value should be an integer, not a float. Math.round() is applied to it by this method.","optional":false,"default":null},{"name":"loop","type":["boolean"],"help":"Should the event loop or not?","optional":false,"default":null},{"name":"repeatCount","type":["number"],"help":"The number of times the event will repeat.","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":["array"],"help":"The values to be sent to your callback function when it is called.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"static":[]},"properties":{"public":[{"name":"autoDestroy","type":["boolean"],"help":"","inlineHelp":"A Timer that is set to automatically destroy itself will do so after all of its events have been dispatched (assuming no looping events).","line":35,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"duration","type":["number"],"help":"","inlineHelp":"The duration in ms remaining until the next event will occur.","line":650,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"events","type":["array Phaser.TimerEvent"],"help":"","inlineHelp":"An array holding all of this timers Phaser.TimerEvent objects. Use the methods add, repeat and loop to populate it.","line":53,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"expired","type":["boolean"],"help":"","inlineHelp":"An expired Timer is one in which all of its events have been dispatched and none are pending.","line":42,"default":"false","public":true,"protected":false,"private":false,"readOnly":true},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"Local reference to game.","line":24,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"length","type":["number"],"help":"","inlineHelp":"The number of pending events in the queue.","line":672,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"ms","type":["number"],"help":"","inlineHelp":"The duration in milliseconds that this Timer has been running for.","line":685,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"next","type":["number"],"help":"","inlineHelp":"The time at which the next event will occur.","line":637,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"onComplete","type":["Phaser.Signal"],"help":"","inlineHelp":"This signal will be dispatched when this Timer has completed, meaning there are no more events in the queue.","line":58,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"paused","type":["boolean"],"help":"","inlineHelp":"The paused state of the Timer. You can pause the timer by calling Timer.pause() and Timer.resume() or by the game pausing.","line":78,"default":"false","public":true,"protected":false,"private":false,"readOnly":true},{"name":"running","type":["boolean"],"help":"","inlineHelp":"True if the Timer is actively running. Do not switch this boolean, if you wish to pause the timer then use Timer.pause() instead.","line":30,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"seconds","type":["number"],"help":"","inlineHelp":"The duration in seconds that this Timer has been running for.","line":707,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"timeCap","type":["number"],"help":"","inlineHelp":"If the difference in time between two frame updates exceeds this value, the event times are reset to avoid catch-up situations.","line":70,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[{"name":"elapsed","type":["number"],"help":"","inlineHelp":"Elapsed time since the last frame (in ms).","line":48,"default":null,"public":false,"protected":true,"private":false,"readOnly":false},{"name":"nextTick","type":["number"],"help":"","inlineHelp":"The time the next tick will occur.","line":65,"default":null,"public":false,"protected":true,"private":false,"readOnly":true}],"private":[{"name":"_codePaused","type":["boolean"],"help":"","inlineHelp":"Was the Timer paused by code or by Game focus loss?","line":84,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_diff","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":133,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_i","type":["number"],"help":"","inlineHelp":"Temp. array counter variable.","line":127,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_len","type":["number"],"help":"","inlineHelp":"Temp. array length variable.","line":115,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_marked","type":["number"],"help":"","inlineHelp":"Temp. counter variable.","line":121,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_newTick","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":139,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_now","type":["number"],"help":"","inlineHelp":"The current start-time adjusted time.","line":109,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_pauseStarted","type":["number"],"help":"","inlineHelp":"The time the game started being paused.","line":97,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_pauseTotal","type":["number"],"help":"","inlineHelp":"Total paused time.","line":103,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_started","type":["number"],"help":"","inlineHelp":"The time at which this Timer instance started running.","line":91,"default":"0","public":false,"protected":false,"private":true,"readOnly":false}]}}