API Docs for: 0.3
Show:

Context Class

Extends Entity
Module: Context
Parent Module: Entities

Context entity

Constructor

Context

(
  • context
)

Parameters:

Methods

addEntity

(
  • joint
)
Description

Parameters:

Returns:

calcNewId

(
  • id
)
Description

Parameters:

Returns:

CallExpression

CreateFromModel

(
  • context
)
Render.Context

Create context view from context entity.

Parameters:

Returns:

Render.Context:

CreateFromPoint

(
  • x
  • y
  • parent
  • options
)
Render.Context

Create context view and context entity.

Parameters:

Returns:

Render.Context:

createGraphics

(
  • context
)

Inherited from Entity but overwritten in src\app\Render\Context.js:61

Create graphics.

Parameters:

destroy

()

Inherited from Entity but overwritten in src\app\Render\Context.js:51

Destroy Context.

destroy

()

Destroy the Context

destroyGraphics

(
  • container
  • graphics
)
Destroy base graphics.

Parameters:

  • container Pixi.Container
  • graphics Pixi.Graphics

dragTo

(
  • pos
  • anchor
)

Drag render context.

Parameters:

  • pos Vec2
  • anchor Vec2

Returns:

getAnchor

() Vec2

Get context center for dragging actions.

Returns:

Vec2:

anchor

getContext

() Context

Get context entity.

Returns:

Context:

context

getHeight

() Number

Gets height.

Returns:

Number:

height

getMaxXY

() Vec2

Gets the context maximun X,Y coordinate.

Returns:

Vec2:

point

getMinXY

() Vec2

Gets the context minimum X,Y coordinate.

Returns:

Vec2:

point

getMobility

() Number

Get context mobility factor.

Returns:

getNearestPoint

(
  • point
  • border
)
Vec2

Get the nearest point in the context to another.

Parameters:

  • point Vec2
  • border Number

    margin inside the context

Returns:

Vec2:

nearest point in the context to the given point

getPos

() Vec2

Inherited from Entity but overwritten in src\app\Render\Context.js:158

Get context center.

Returns:

Vec2:

position

getRandomPoint

() Vec2

Get a random point in the context.

Returns:

Vec2:

point

getTrigger

() Boolean

Get context trigger option.

Returns:

Boolean:

true if contexts stops simulation on empty of agents

getWidth

() Number

Gets width.

Returns:

Number:

width

in

(
  • pos
)
Boolean

Check if a point is inside the context.

Parameters:

  • pos Vec2

Returns:

Boolean:

true if pos is inside

incrSize

(
  • ds
)

Increment the context width and height.

Parameters:

  • ds Number

    increment in width and height

removeEntity

(
  • joint
)
Description

Parameters:

Returns:

render

(
  • options
)

Inherited from Entity but overwritten in src\app\Render\Context.js:102

Animate context, update position and size.

Parameters:

setArea

(
  • x
  • y
)

Sets the context size.

Parameters:

setArea

(
  • x
  • y
)

Set context area, from its center.

Parameters:

setInteractive

(
  • displayObject
)
Set render entity as interactive.

Parameters:

  • displayObject Pixi.DisplayObject

updatePos

(
  • x
  • y
)
Description

Parameters:

Returns: