Members
string
constant FLAPS
Used to define iteration / time value calculated as frames(flaps) per second
Example
import { FLAPS, Hummingbird } from 'hummingbird'
Hummingbird(function() { ... }, {
lifeSpan: 6
lifeSpanIn: FLAPS
})
string
constant SECONDS
Used to define iteration / time value calculated in seconds
Example
import { SECONDS, Hummingbird } from 'hummingbird'
Hummingbird(function() { ... }, {
speed: 1.3
speedIn: SECONDS
})
Methods
release(argsopt)
Will stop a method from being called by the engine. Removes the instances from the internal pools.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
Hummingbird | Flock |
<optional> |
Any number of instances to be removed from the engine to no longer be called |
Example
function foo() { ... }
function bar() { ... }
const fooBird = Hummingbird(foo)
const barBird = Hummingbird(bar)
// release all by naming each
Hummingbird.release(foo, bar)
// or omit and will release everything
Hummingbird.release()
sleep(argsopt)
Will stop a method from being called by the engine temporarily.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
Hummingbird | Flock |
<optional> |
Any number of Hummingbird instances to be removed from loop |
Example
function foo() { ... }
function bar() { ... }
const fooBird = Hummingbird(foo)
const barBird = Hummingbird(bar)
// sleep all by naming each
Hummingbird.sleep(foo, bar)
// or omit and will sleep everything
Hummingbird.sleep()
wake(argsopt)
Will resume a method being called by the engine.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
Hummingbird | Flock |
<optional> |
Any number of Hummingbird instances to be removed from loop |
Example
function foo() { ... }
function bar() { ... }
const fooBird = Hummingbird(foo)
const barBird = Hummingbird(bar)
Hummingbird.sleep()
// wake by naming each
Hummingbird.wake(foo, bar)
// or omit and will wake everything
Hummingbird.wake()