1.2.0 • Published 7 years ago

yy-update v1.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

update.js

update loop API for javascript apps

Live Example with Source

https://davidfig.github.io/update/

Installation

npm install yy-update

API Reference

Functions

init(options)

must call init() before using Update

Kind: global function

ParamTypeDescription
optionsobject
options.Debugobjectpass Debug from github.com/davidfig/debug
options.countboolean | stringshow debug counts (can supply side for panel, e.g., 'topleft')
options.percentboolean | stringshow debug percentage
options.FPSboolean | stringshow debug FPS
options.onLoopfunctioncall at end of update loop

registerPause(pause, resume)

register functions to call after Update pauses or resumes

Kind: global function

ParamType
pausefunction
resumefunction

pauseGame()

pauses all updates

Kind: global function

resumeGame()

resumes all updates

Kind: global function

add(funct, options)

adds a function to the update loop

Kind: global function

ParamTypeDefaultDescription
functfunction
optionsobject
options.timenumber0in milliseconds to call this function
options.FPSnumberthis replaces options.time and calls the function at the desired FPS
options.oncebooleanfalsecall only once and then remove from update queue
options.percentstringname to track the percentage in the debug panel

clear()

removes all updates and clears the percentage list

Kind: global function

remove(update)

removes an update from the loop

Kind: global function

ParamTypeDescription
updateobjectobject returned by add()

update()

starts the update loop

Kind: global function


Copyright (c) 2017 YOPEY YOPEY LLC - MIT License - Documented by jsdoc-to-markdown

1.2.0

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.0.8

7 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago