BaseObject2D

$e. BaseObject2D

new BaseObject2D(name, pos)

Source:
Properties:
Name Type Description
id number Internal ID
name string Object's name
posOrigin Vector2 Original Positon
scale Vector2 Scale
rotation number Rotation
pivot Vector2 Rotation Pivot
lookAtTarget BaseObject2D Target look at
lookAtOffset Vector2 Offset pivot on target look at
color string Color
layer number Layer
parent BaseObject2D Parent Object. If set, the position is relative to the parent
BaseObject2D - Base class of Object2D without all the physics properties
Parameters:
Name Type Description
name string Name
pos Vector2 Position

Methods

getPos() → {Vector2}

Source:
BaseObject2D.prototype.getPos - Returns the object position
Returns:
A Vector2 Representing the Object position
Type
Vector2

lookAt(Obj2)

Source:
BaseObject2D.prototype.lookAt - Rotates the object to looks at a target
Parameters:
Name Type Description
Obj2 BaseObject2D The target

setParent(parent)

Source:
BaseObject2D.prototype.setParent - Sets the object's parent
Parameters:
Name Type Description
parent BaseObject2D The BaseObject2D parent

setPivot(value)

Source:
BaseObject2D.prototype.setPivot - Sets the pivot to the Object2D
Parameters:
Name Type Description
value Vector2 The Pivot

setPos(v2)

Source:
BaseObject2D.prototype.setPos - Sets the position of the BaseObject2D
Parameters:
Name Type Description
v2 Vector2 The new position