API Docs for: 0.3
Show:

Line Class

Extends Entity
Module: LinePrototype
Parent Module: Entities

Line Base

Constructor

Line

(
  • x
  • y
  • parent
  • [options]
  • id
)

Parameters:

  • x Number

    coordinate

  • y Number

    coordinate

  • parent World

    world

  • [options] Object optional
  • id String

    to use insted of autogenerate it, used when loading world

Methods

addEntity

(
  • joint
  • options
)

Inherited from Entity but overwritten in src\sim\Entities\Helpers\LinePrototype.js:57

Request to add a children Joint entity.

Parameters:

addJoint

(
  • x
  • y
  • options
  • id
)
Joint

Helper to create a new Joint.

Parameters:

Returns:

Joint:

joint

addJoints

(
  • joints
)

Request to add a list of children Joint entities.

Parameters:

calcNewId

(
  • id
)

Description

Parameters:

Returns:

CallExpression

createGraphics

(
  • container
  • graphics
)
Pixi.Graphics

Create base grahpics.

Parameters:

  • container Pixi.Container
  • graphics Pixi.Graphics

    , optional created otherwise

Returns:

Pixi.Graphics:

graphics

destroy

()

Inherited from Entity but overwritten in src\sim\Entities\Helpers\LinePrototype.js:43

Destroy the line

destroyGraphics

(
  • container
  • graphics
)

Destroy base graphics.

Parameters:

  • container Pixi.Container
  • graphics Pixi.Graphics

getJointByIdx

(
  • idx
)
Joint

Get a joint by index in the path.

Parameters:

Returns:

Joint:

joint or null

getJointIdx

(
  • joint
)
Number

Get a joint index in the path/wall

Parameters:

Returns:

Number:

index or -1 if not found

getJoints

() Array

Gets the childen joints.

Returns:

Array:

joints

getPos

() Vec2

Get entity position.

Returns:

Vec2:

position.

getProjection

(
  • point
  • segment
)
Vec2

Get the projection from a point to a given segment.

Parameters:

  • point Vec2
  • segment Number

    index

Returns:

Vec2:

projection from point to segment

getWidth

() Number

Get [options.width].

Returns:

Number:

width

removeEntity

(
  • joint
)

Inherited from Entity but overwritten in src\sim\Entities\Helpers\LinePrototype.js:78

Request to remove a children Joint entity.

Parameters:

render

(
  • graphics
)

Animate entity.

Parameters:

  • graphics Pixi.Graphics

reverse

()

Reverse the internal joints lists.

setInteractive

(
  • displayObject
)

Set render entity as interactive.

Parameters:

  • displayObject Pixi.DisplayObject

updatePos

(
  • x
  • y
)

Description

Parameters:

Returns: