Set the alpha values used by the Rope during rendering.
You can provide the values in a number of ways:
setAlphas(0.5)
- This will set a single alpha for the whole Rope.setAlphas(1, 0.5)
- This will set a 'top' and 'bottom' alpha value across the whole Rope.setAlphas([ 1, 0.5, 0.2 ])
If you provide an array of values and the array has exactly the same number of values as points
in the Rope, it
will use each alpha value per rope segment.
If the provided array has a different number of values than points
then it will use the values in order, from
the first Rope segment and on, until it runs out of values. This allows you to control the alpha values at all
vertices in the Rope.
Note this method is called setAlphas
(plural) and not setAlpha
.
name | type | arguments | description |
---|---|---|---|
alphas | number | Array.<number> | <optional> |
Either a single alpha value, or an array of values. If nothing is provided alpha is reset to 1. |
bottomAlpha | number | <optional> |
An optional bottom alpha value. See the method description for details. |
This Game Object instance.