API Docs for: 2.2.1
Show:

InteractionData Class

Holds all information related to an Interaction event

Constructor

InteractionData

()

Methods

AjaxRequest

()

A wrapper for ajax requests to be handled cross browser

begin

()

Begin stats

canUseNewCanvasBlendModes

() Bool

Checks whether the Canvas BlendModes are supported by the current browser

Returns:

Bool:

whether they are supported

end

()

End stats

getLocalPosition

(
  • displayObject
  • [point]
)
Point

This will return the local coordinates of the specified displayObject for this InteractionData

Parameters:

  • displayObject DisplayObject

    The DisplayObject that you would like the local coords off

  • [point] Point optional

    A Point object in which to store the value, optional (otherwise will create a new point)

Returns:

Point:

A point containing the coordinates of the InteractionData position relative to the DisplayObject

getNextPowerOfTwo

(
  • number
)
Float

Given a number, this function returns the closest number that is a power of two this function is taken from Starling Framework as its pretty neat ;)

Parameters:

  • number Float

Returns:

Float:

the closest number that is a power of two

hex2rgb

(
  • hex
)

Converts a hex color number to an [R, G, B] array

Parameters:

  • hex Float

Returns:

Array

isPowerOfTwo

(
  • width
  • height
)
Bool

checks if the given width and height make a power of two texture

Parameters:

  • width Float
  • height Float

Returns:

Bool:

rgb2hex

(
  • rgb
)

Converts a color as an [R, G, B] array to a hex number

Parameters:

Returns:

Float

setMode

(
  • value
)

Sets the display mode.

Parameters:

  • value Int

    0: fps, 1: ms

update

()

Update stats

Properties

domElement

DivElement

Stats DOM element

global

Point

This point stores the global coords of where the touch/mouse event happened

originalEvent

Event

When passed to an event handler, this will be the original DOM Event that was captured

target

Sprite

The target Sprite that was interacted with