DisplayProps Class
Used for calculating and encapsulating display related properties.
Constructor
DisplayProps
-
[visible=true]
-
[alpha=1]
-
[shadow=null]
-
[compositeOperation=null]
-
[matrix]
Parameters:
-
[visible=true]
Number optionalVisible value.
-
[alpha=1]
Number optionalAlpha value.
-
[shadow=null]
Number optionalA Shadow instance or null.
-
[compositeOperation=null]
Number optionalA compositeOperation value or null.
-
[matrix]
Number optionalA transformation matrix. Defaults to a new identity matrix.
Item Index
Properties
Methods
append
-
visible
-
alpha
-
shadow
-
compositeOperation
-
[matrix]
Appends the specified display properties. This is generally used to apply a child's properties its parent's.
Parameters:
Returns:
This instance. Useful for chaining method calls.
clone
()
DisplayProps
Returns a clone of the DisplayProps instance. Clones the associated matrix.
Returns:
a clone of the DisplayProps instance.
identity
()
DisplayProps
chainable
Resets this instance and its matrix to default values.
Returns:
This instance. Useful for chaining method calls.
prepend
-
visible
-
alpha
-
shadow
-
compositeOperation
-
[matrix]
Prepends the specified display properties. This is generally used to apply a parent's properties to a child's. For example, to get the combined display properties that would be applied to a child, you could use:
var o = myDisplayObject;
var props = new createjs.DisplayProps();
do {
// prepend each parent's props in turn:
props.prepend(o.visible, o.alpha, o.shadow, o.compositeOperation, o.getMatrix());
} while (o = o.parent);
Parameters:
Returns:
This instance. Useful for chaining method calls.
setValues
-
[visible=true]
-
[alpha=1]
-
[shadow=null]
-
[compositeOperation=null]
-
[matrix]
Reinitializes the instance with the specified values.
Parameters:
-
[visible=true]
Number optionalVisible value.
-
[alpha=1]
Number optionalAlpha value.
-
[shadow=null]
Number optionalA Shadow instance or null.
-
[compositeOperation=null]
Number optionalA compositeOperation value or null.
-
[matrix]
Number optionalA transformation matrix. Defaults to an identity matrix.
Returns:
This instance. Useful for chaining method calls.
Properties
compositeOperation
String
Property representing the compositeOperation that will be applied to a display object. You can find a list of valid composite operations at: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Compositing
visible
Boolean
Property representing the value for visible that will be applied to a display object.