me.DraggableEntity(x, y, settings)

new DraggableEntity(x, y, settings)

Used to make a game entity draggable

Parameters:
Name Type Description
x Number

the x coordinates of the entity object

y Number

the y coordinates of the entity object

settings Object

Entity properties (see me.Entity)

Extends

Members

alpha :Number

Define the renderable opacity
Set to zero if you do not wish an object to be drawn

Inherited From:
Default Value:
  • 1.0
See:
  • me.Renderable#setOpacity
  • me.Renderable#getOpacity

ancestor :me.Container|me.Entity

a reference to the parent object that contains this renderable

Inherited From:
Default Value:
  • undefined

Methods

static destroy()

Destructor

static dragEnd(x)

Gets called when the user stops dragging the entity

Parameters:
Name Type Description
x Object

the pointer event

static dragMove(x)

Gets called when the user drags this entity around

Parameters:
Name Type Description
x Object

the pointer event

static dragStart(x)

Gets called when the user starts dragging the entity

Parameters:
Name Type Description
x Object

the pointer event

static init(x, y, settings)

Constructor

Parameters:
Name Type Description
x Number

the x postion of the entity

y Number

the y postion of the entity

settings Object

the additional entity settings

static initEvents()

Initializes the events the modules needs to listen to It translates the pointer events to me.events in order to make them pass through the system and to make this module testable. Then we subscribe this module to the transformed events.

static translatePointerEvent(e, translation)

Translates a pointer event to a me.event

Parameters:
Name Type Description
e Object

the pointer event you want to translate

translation String

the me.event you want to translate the event to