InteractionData Class
Holds all information related to an Interaction event
Constructor
InteractionData
()
Item Index
Methods
Properties
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:
whether they are supported
end
()
End stats
getLocalPosition
-
displayObject
-
[point]
This will return the local coordinates of the specified displayObject for this InteractionData
Parameters:
-
displayObject
DisplayObjectThe DisplayObject that you would like the local coords off
-
[point]
Point optionalA Point object in which to store the value, optional (otherwise will create a new point)
Returns:
A point containing the coordinates of the InteractionData position relative to the DisplayObject
getNextPowerOfTwo
-
number
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:
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
checks if the given width and height make a power of two texture
Parameters:
-
width
Float -
height
Float
Returns:
rgb2hex
-
rgb
Converts a color as an [R, G, B] array to a hex number
Parameters:
-
rgb
Array
Returns:
Float
setMode
-
value
Sets the display mode.
Parameters:
-
value
Int0: fps, 1: ms
update
()
Update stats
Properties
domElement
DivElement
Stats DOM element
originalEvent
Event
When passed to an event handler, this will be the original DOM Event that was captured