Class Fz2D.Group
| Defined in: | src/scene/objects/group.coffee |
| Inherits: | Fz2D.Object |
Overview
Instance Method Summary
- ::add(object) Adds an object.
- ::allAlive() Returns true if all objects are alive.
- ::allDead() Returns true if all objects are dead.
- ::any() Returns true if the group has at least one object.
- ::at(i) Returns object at a given index.
- ::clear() Removes all objects.
- ::constructor(x = 0, y = 0, w = 0, h = 0) Constructor.
- ::draw(ctx) Draws group on every frame.
- ::each(cb) Iterates over each object.
- ::eachByClass(klass, cb) Iterates over each object of a given class.
- ::find(cb, arg) Iterates over each object and calls the given callback.
- ::findByClass(klass) Finds an object by class.
- ::findByTag(tag) Finds an object by tag.
- ::first() Returns first object.
- ::firstAlive() Returns first Fz2D.Object that is alive.
- ::firstAliveByClass(klass) Returns first Fz2D.Object by class that is alive.
- ::firstAliveByTag(tag) Returns first Fz2D.Object by tag that is alive.
- ::firstAvail() Returns first Fz2D.Object that doesn't exist.
- ::firstAvailByClass(klass) Returns first Fz2D.Object by class that doesn't exist.
- ::firstAvailByTag(tag) Returns first Fz2D.Object by tag that doesn't exist.
- ::firstDead() Returns first Fz2D.Object that is dead.
- ::firstDeadByClass(klass) Returns first Fz2D.Object by class that is dead.
- ::firstDeadByTag(tag) Returns first Fz2D.Object by tag that is dead.
- ::firstExisting() Returns first Fz2D.Object that exist.
- ::firstExistingByClass(klass) Returns first Fz2D.Object by class that exist.
- ::firstExistingByTag(tag) Returns first Fz2D.Object by tag that exist.
- ::firstVisible() Returns first Fz2D.Object that is visible.
- ::firstVisibleByClass(klass) Returns first Fz2D.Object by class that is visible.
- ::firstVisibleByTag(tag) Returns first Fz2D.Object by tag that is visible.
- ::hasAlive() Returns true if there's at least one object that is alive.
- ::hasAliveByClass(klass) Returns true if there's at least one object that is alive with the given class.
- ::hasAliveByTag(tag) Returns true if there's at least one object that is alive with the given tag.
- ::hasDead() Returns true if there's at least one object that is dead.
- ::hasDeadByClass(klass) Returns true if there's at least one object that is dead with the given class.
- ::hasDeadByTag(tag) Returns true if there's at least one object that is dead with the given tag.
- ::hasVisible() Returns true if there's at least one object that is visible.
- ::hasVisibleByClass(klass) Returns true if there's at least one object that is visible with the given class.
- ::hasVisibleByTag(tag) Returns true if there's at least one object that is visible with the given tag.
- ::hide() Hides all objects.
- ::kill() Kills all objects.
- ::last() Returns last object.
- ::length() Returns the number of objects.
- ::range(i, n, cb) Iterates over all objects within the given range.
- ::recycle() Recycle an object.
- Fz2D.Object ::recycleByClass(klass) Recycle an object by class.
- Fz2D.Object ::recycleByTag(tag) Recycle an object by tag.
- ::remove(object) Removes an object.
- ::removeByClass(klass) Removes an object by class.
- ::removeByIndex(i) Removes an object by index.
- ::removeByTag(tag) Removes an object by tag.
- ::reset() Resets all objects.
- ::reverseFind(cb, arg) Iterates over each object in reverse order and calls the given callback.
- ::show() Shows all objects.
- ::sort(cb) Sorts objects.
- ::sortByZ() Sorts objects by their z value.
- ::update(timer, input) Updates group on every frame.
Inherited Method Summary
Methods inherited from Fz2D.Object
.constructor, .kill, .reset, .show, .hide, .draw, .update
Constructor Details
::constructor(x = 0, y = 0, w = 0, h = 0) Source
Instance Method Details
::add(object) Source
::allAlive() Source
::allDead() Source
::any() Source
::at(i) Source
::clear() Source
::draw(ctx) Source
::each(cb) Source
::eachByClass(klass, cb) Source
::find(cb, arg) Source
::findByClass(klass) Source
::findByTag(tag) Source
::first() Source
::firstAlive() Source
::firstAliveByClass(klass) Source
::firstAliveByTag(tag) Source
::firstAvail() Source
::firstAvailByClass(klass) Source
::firstAvailByTag(tag) Source
::firstDead() Source
::firstDeadByClass(klass) Source
::firstDeadByTag(tag) Source
::firstExisting() Source
::firstExistingByClass(klass) Source
::firstExistingByTag(tag) Source
::firstVisible() Source
::firstVisibleByClass(klass) Source
::firstVisibleByTag(tag) Source
::hasAlive() Source
::hasAliveByClass(klass) Source
::hasAliveByTag(tag) Source
::hasDead() Source
::hasDeadByClass(klass) Source
::hasDeadByTag(tag) Source
::hasVisible() Source
::hasVisibleByClass(klass) Source
::hasVisibleByTag(tag) Source
::hide() Source
::kill() Source
::last() Source
::length() Source
::range(i, n, cb) Source
::recycle() Source
Fz2D.Object ::recycleByClass(klass) Source
Fz2D.Object ::recycleByTag(tag) Source
::remove(object) Source
::removeByClass(klass) Source
::removeByIndex(i) Source
::removeByTag(tag) Source
::reset() Source
::reverseFind(cb, arg) Source
::show() Source
::sort(cb) Source
::sortByZ() Source
::update(timer, input) Source