API Docs for: 0.1.0
Show:

zerk.game.engine.system.wireframe Class

Wireframe System

Render the world as wireframes for debugging purposes.

Methods

_getConfigDefaults

() Object protected

Returns the configuration defaults of the system

Returns:

Object: Default configuration

_getFixtureBoundingStyle

(
  • entity
  • body
  • fixture
)
Object protected

Returns the style of a fixture bounding shape

Parameters:

Returns:

Object: An object containing strokeColor, fillColor and lineWidth

_getSystem

(
  • name
)
zerk.game.engine.system protected

Returns system by given name

This method is used to communicate with other systems.

Parameters:

  • name String

    System name

Returns:

zerk.game.engine.system: System instance

_log

(
  • message
  • severity
)
protected

Local log method

Parameters:

  • message String

    Log message

  • severity Integer

    Log severity

_renderBody

(
  • entity
  • body
)
protected

Renders a body onto the game canvas

Parameters:

_renderBodyAngleIndicator

(
  • entity
  • body
)
protected

Renders an angle indicator for each body of the entity

Parameters:

_renderEntity

(
  • entity
)
protected

Renders an entity onto the game canvas

Parameters:

_renderEntityOriginIndicator

(
  • entity
)
protected

Renders the entity origin indicator

Parameters:

_renderFixture

(
  • entity
  • body
  • fixture
)
protected

Renders a fixture onto the body buffer canvas

Parameters:

_renderFixtureBoundingCircle

(
  • entity
  • body
  • fixture
)
protected

Renders the bounding area for a circle shaped fixture

Parameters:

_renderFixtureBoundingPolygon

(
  • entity
  • body
  • fixture
)
protected

Renders the bounding area for a polygon shaped fixture

Parameters:

_renderFixtureBoundingShape

(
  • entity
  • body
  • fixture
)
protected

Renders a shape indicating the bounding area of a fixture

Delegate method for the fixture bounding shape methods

Parameters:

_renderFixtureBoundingShape

(
  • entity
  • body
  • fixture
)
protected

Renders the bounding area for a box shaped fixture

Parameters:

addEntity

(
  • entity
)

Adds an entity to the system

Parameters:

fireEvent

(
  • event
)
Boolen

Fire event

Parameters:

  • event String

    Event name

Returns:

Boolen: Returns false when the bubble was canceled

getName

() String

Returns the name of the system

Returns:

String: System name

getPriority

() Integer

Returns the priority of the system

Returns:

Integer: System priority

getThread

() String

Returns the thread the systems runs in

Returns:

String: Thread name

init

(
  • engine
  • config
)

Class constructor

Parameters:

on

(
  • event
  • callback
  • scope
)

Register event handler

Parameters:

  • event String

    Event name

  • callback Function

    Callback function. Return false to cancel event bubble.

  • scope Object

    Scope to be used in callback function

removeEntity

(
  • entity
)

Removes an entity from the system

Parameters:

start

()

Starts the system

stop

()

Stops the system

un

(
  • event
  • callback
)
Boolen

Unregister event handler

Parameters:

  • event String

    Event name

  • callback Function

    Callback function

Returns:

Boolen: Returns true on success

update

()

Updates the system

useComponent

(
  • name
)
Boolean

Returns true when the system is interested in given component

Parameters:

  • name String

    Component name

Returns:

Boolean: True when the system is intereseted in given component

Properties

_config

Object protected

System configuration

_engine

zerk.game.engine protected

Engine instance

Back reference to the engine instance.

_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

_physics

zerk.game.engine.system.physics protected

Physics system instance

_priority

Integer protected

Priority of this system

_thread

String protected

Thread that runs this system

_viewport

zerk.game.engine.system.viewport protected

Viewport system instance