Class: Sprite

Sprite


new Sprite(x, y)

Base class for position based objects

Parameters:
Name Type Argument Description
x Integer <optional>

The initial x position. Default is 0

y Integer <optional>

The initial y position. Default is 0

Author:
  • Chris Peters
Source:

Members


<static> _compositeDefault :String

Type:
  • String
Source:

_composite :String

The composite operation type. Can be source-atop|source-in|source-out|source-over|destination-atop|destination-in|destination-out|destination-over|lighter|xor|copy
Default is 'source-over'

Type:
  • String
Source:

Methods


<static> getCompositeDefault()

Source:
Returns:
Type
String

getBoundingArea()

Source:
Returns:

The bounding area

Type
Object

getComposite()

Source:
Returns:
Type
String

getHeight()

Source:
Returns:
Type
Integer

getOpacity()

Source:
Returns:
Type
Float

getPivotX()

Source:
Returns:
Type
Integer

getPivotY()

Source:
Returns:
Type
Integer

getRotation()

Source:
Returns:
Type
Float

getRotation()

Source:
Returns:
Type
Float

getScaleX()

Source:
Returns:
Type
Integer

getScaleY()

Source:
Returns:
Type
Integer

getSrcHeight()

Source:
Returns:
Type
Integer

getSrcWidth()

Source:
Returns:
Type
Integer

getSrcX()

Source:
Returns:
Type
Integer

getSrcY()

Source:
Returns:
Type
Integer

getWidth()

Source:
Returns:
Type
Integer

getX()

Source:
Returns:
Type
Integer

getY()

Source:
Returns:
Type
Integer

render(context)

Parameters:
Name Type Description
context Object

The canvas' context

Source:

setComposite(val)

Parameters:
Name Type Description
val Integer

The x value

Source:
Returns:
Type
Sprite

setComposite(val)

Parameters:
Name Type Description
val Integer

The composite value

Source:
Returns:
Type
Sprite

setHeight(val)

Parameters:
Name Type Description
val Integer

The height value

Source:
Returns:
Type
Sprite

setOpacity(val)

Parameters:
Name Type Description
val Float

The opacity value

Source:
Returns:
Type
Sprite

setPivotX(val)

Parameters:
Name Type Description
val Float

The opacity value

Source:
Returns:
Type
Sprite

setPivotY(val)

Parameters:
Name Type Description
val Float

The opacity value

Source:
Returns:
Type
Sprite

setRotation(val)

Parameters:
Name Type Description
val Integer

The rotation value

Source:
Returns:
Type
Sprite

setScaleX(val)

Parameters:
Name Type Description
val Integer

The scaleX value

Source:
Returns:
Type
Sprite

setScaleY(val)

Parameters:
Name Type Description
val Integer

The scaleY value

Source:
Returns:
Type
Sprite

setSrcHeight(val)

Parameters:
Name Type Description
val Integer

The srcHeight value

Source:
Returns:
Type
Sprite

setSrcWidth(val)

Parameters:
Name Type Description
val Integer

The srcWidth value

Source:
Returns:
Type
Sprite

setSrcX(val)

Parameters:
Name Type Description
val Integer

The srcX value

Source:
Returns:
Type
Sprite

setSrcY(val)

Parameters:
Name Type Description
val Integer

The srcY value

Source:
Returns:
Type
Sprite

setWidth(val)

Parameters:
Name Type Description
val Integer

The width value

Source:
Returns:
Type
Sprite

setY(val)

Parameters:
Name Type Description
val Integer

The y value

Source:
Returns:
Type
Sprite

translate(x, y)

Add/Subtract current x/y values. Assign any non-number to leave value the same.

Parameters:
Name Type Argument Description
x Integer <optional>
y Integer <optional>
Source:
Returns:
Type
Sprite