zerk.game.engine.system.sprite Class
Sprite Systems
Renders sprites.
Item Index
Methods
- __getBodyBufferSize
- _getConfigDefaults
- _getFixtureBufferSize
- _getSystem
- _log
- _renderBody
- _renderEntity
- _renderFixture
- _renderFixtureBoundingCircle
- _renderFixtureBoundingPolygon
- _renderFixtureBoundingShape
- _renderFixtureBoundingShape
- _renderSprite
- addEntity
- fireEvent
- getName
- getPriority
- getThread
- init
- on
- removeEntity
- start
- stop
- un
- update
- useComponent
Methods
__getBodyBufferSize
-
entity
-
body
Calculate buffer size of a body
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
Returns:
_getConfigDefaults
()
Object
protected
Returns the configuration defaults of the system
Returns:
_getFixtureBufferSize
-
entity
-
body
-
fixture
Calculate buffer size of a fixture
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
-
fixture
config.component.physics.fixtureFixture state
Returns:
_getSystem
-
name
Returns system by given name
This method is used to communicate with other systems.
Parameters:
-
name
StringSystem name
Returns:
_log
-
message
-
severity
Local log method
Parameters:
-
message
StringLog message
-
severity
IntegerLog severity
_renderBody
-
entity
-
body
Renders a body onto the game canvas
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
_renderEntity
-
entity
Renders an entity onto the game canvas
Parameters:
-
entity
config.entityEntity state
_renderFixture
-
entity
-
body
-
fixture
Renders a fixture onto the body buffer canvas
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
-
fixture
config.component.physics.fixtureFixture state
_renderFixtureBoundingCircle
-
entity
-
body
-
fixture
Renders the bounding area for a circle shaped fixture
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
-
fixture
config.component.physics.fixtureFixture state
_renderFixtureBoundingPolygon
-
entity
-
body
-
fixture
Renders the bounding area for a polygon shaped fixture
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
-
fixture
config.component.physics.fixtureFixture state
_renderFixtureBoundingShape
-
entity
-
body
-
fixture
Renders a shape indicating the bounding area of a fixture
Delegate method for the fixture bounding shape methods.
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
-
fixture
config.component.physics.fixtureFixture state
_renderFixtureBoundingShape
-
entity
-
body
-
fixture
Renders the bounding area for a box shaped fixture
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
-
fixture
config.component.physics.fixtureFixture state
_renderSprite
-
entity
-
body
-
fixture
-
sprite
Render sprite
Parameters:
-
entity
config.entityEntity state
-
body
config.component.physics.bodyBody state
-
fixture
config.component.physics.fixtureFixture state
-
sprite
config.component.sprite
fireEvent
-
event
Fire event
Parameters:
-
event
StringEvent name
Returns:
getName
()
String
Returns the name of the system
Returns:
getPriority
()
Integer
Returns the priority of the system
Returns:
getThread
()
String
Returns the thread the systems runs in
Returns:
init
-
engine
-
config
Class constructor
Parameters:
-
engine
zerk.game.engineGame engine
-
config
ObjectSystem configuration
on
-
event
-
callback
-
scope
Register event handler
Parameters:
-
event
StringEvent name
-
callback
FunctionCallback function. Return false to cancel event bubble.
-
scope
ObjectScope to be used in callback function
removeEntity
-
entity
Removes an entity from the system
Parameters:
-
entity
config.entityEntity state
start
()
Starts the system
stop
()
Stops the system
un
-
event
-
callback
Unregister event handler
Parameters:
-
event
StringEvent name
-
callback
FunctionCallback function
Returns:
update
()
Updates the system
useComponent
-
name
Returns true when the system is interested in given component
Parameters:
-
name
StringComponent name
Returns:
Properties
_config
Object
protected
System configuration
_entities
Array
protected
Entities register
Entities that this system is interested in.
_eventListeners
Array
protected
List of event handlers
_name
String
protected
Name of the system
_priority
Integer
protected
Priority of this system
_thread
String
protected
Thread that runs this system