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 |
Members
-
<static> _compositeDefault :String
-
Type:
- String
-
_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
Methods
-
<static> getCompositeDefault()
-
Returns:
- Type
- String
-
getBoundingArea()
-
Returns:
The bounding area
- Type
- Object
-
getComposite()
-
Returns:
- Type
- String
-
getHeight()
-
Returns:
- Type
- Integer
-
getOpacity()
-
Returns:
- Type
- Float
-
getPivotX()
-
Returns:
- Type
- Integer
-
getPivotY()
-
Returns:
- Type
- Integer
-
getRotation()
-
Returns:
- Type
- Float
-
getRotation()
-
Returns:
- Type
- Float
-
getScaleX()
-
Returns:
- Type
- Integer
-
getScaleY()
-
Returns:
- Type
- Integer
-
getSrcHeight()
-
Returns:
- Type
- Integer
-
getSrcWidth()
-
Returns:
- Type
- Integer
-
getSrcX()
-
Returns:
- Type
- Integer
-
getSrcY()
-
Returns:
- Type
- Integer
-
getWidth()
-
Returns:
- Type
- Integer
-
getX()
-
Returns:
- Type
- Integer
-
getY()
-
Returns:
- Type
- Integer
-
render(context)
-
Parameters:
Name Type Description context
Object The canvas' context
-
setComposite(val)
-
Parameters:
Name Type Description val
Integer The x value
Returns:
- Type
- Sprite
-
setComposite(val)
-
Parameters:
Name Type Description val
Integer The composite value
Returns:
- Type
- Sprite
-
setHeight(val)
-
Parameters:
Name Type Description val
Integer The height value
Returns:
- Type
- Sprite
-
setOpacity(val)
-
Parameters:
Name Type Description val
Float The opacity value
Returns:
- Type
- Sprite
-
setPivotX(val)
-
Parameters:
Name Type Description val
Float The opacity value
Returns:
- Type
- Sprite
-
setPivotY(val)
-
Parameters:
Name Type Description val
Float The opacity value
Returns:
- Type
- Sprite
-
setRotation(val)
-
Parameters:
Name Type Description val
Integer The rotation value
Returns:
- Type
- Sprite
-
setScaleX(val)
-
Parameters:
Name Type Description val
Integer The scaleX value
Returns:
- Type
- Sprite
-
setScaleY(val)
-
Parameters:
Name Type Description val
Integer The scaleY value
Returns:
- Type
- Sprite
-
setSrcHeight(val)
-
Parameters:
Name Type Description val
Integer The srcHeight value
Returns:
- Type
- Sprite
-
setSrcWidth(val)
-
Parameters:
Name Type Description val
Integer The srcWidth value
Returns:
- Type
- Sprite
-
setSrcX(val)
-
Parameters:
Name Type Description val
Integer The srcX value
Returns:
- Type
- Sprite
-
setSrcY(val)
-
Parameters:
Name Type Description val
Integer The srcY value
Returns:
- Type
- Sprite
-
setWidth(val)
-
Parameters:
Name Type Description val
Integer The width value
Returns:
- Type
- Sprite
-
setY(val)
-
Parameters:
Name Type Description val
Integer The y value
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>
Returns:
- Type
- Sprite