API Docs for: 0.3
Show:

Render Class

Module: Render
Parent Module: CrowdSimApp

Initialices rendering and animate entities.

Constructor

Render

(
  • canvas
  • w
  • h
  • options
)

Parameters:

Methods

animate

()

Rendering loop.

drawHelperLine

(
  • x0
  • y0
  • x1
  • y1
)

Draw a helper line from 0 to 1.

Parameters:

getHeight

() Number

Get stage height.

Returns:

Number:

height

getWidth

() Number

Get stage width.

Returns:

Number:

width

init

(
  • textures
  • events
)

Initialice render.

Parameters:

  • textures Array

    coordinates for create Pixi.Textures.

  • events Array

    to receive world callbacks

pan

(
  • dx
  • dy
)

Pan view of stage.

Parameters:

resize

(
  • w
  • h
)

Resize rendering stage.

Parameters:

screenToWorld

(
  • x
  • y
)
Object

Convert screen coordinates to world coordinates.

Parameters:

Returns:

Object:

world coordinate {x:x,y:y}

setWorld

(
  • world
)

Set current rendered world.

Parameters:

start

()

Start rendering loop.

stop

()

Stop rendering loop.

worldToScreen

(
  • x
  • y
)
Object

Convert world coordinates to screen coordinates.

Parameters:

Returns:

Object:

screen coordinate {x:x,y:y}

zoom

(
  • scale
  • x
  • y
)

Zoom-in, zoom-out stage.

Parameters: