MCPcopy
hub / github.com/phaserjs/phaser / Alpha

Interface Alpha

types/phaser.d.ts:18037–18086  ·  view source on GitHub ↗

* Provides methods and properties for managing the alpha (opacity) of a Game Object. * Alpha values range from 0 (fully transparent) to 1 (fully opaque). * * Under WebGL, alpha can be set independently for each of the four corners of the * Game Ob

Source from the content-addressed store, hash-verified

18035 * not be used directly.
18036 */
18037 interface Alpha {
18038 /**
18039 * Clears all alpha values associated with this Game Object.
18040 *
18041 * Immediately sets the alpha levels back to 1 (fully opaque).undefined
18042 * @returns This Game Object instance.
18043 */
18044 clearAlpha(): this;
18045 /**
18046 * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders.
18047 * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.
18048 *
18049 * If your game is running under WebGL you can optionally specify four different alpha values, each of which
18050 * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used.
18051 * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1.
18052 * @param topRight The alpha value used for the top-right of the Game Object. WebGL only.
18053 * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only.
18054 * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only.
18055 * @returns This Game Object instance.
18056 */
18057 setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this;
18058 /**
18059 * The alpha value of the Game Object, between 0 (fully transparent) and 1 (fully opaque).
18060 *
18061 * This is a global value that impacts the entire Game Object. Setting it also updates
18062 * all four corner alpha values (`alphaTopLeft`, `alphaTopRight`, `alphaBottomLeft`,
18063 * `alphaBottomRight`) to the same value. The input is clamped to the range [0, 1].
18064 */
18065 alpha: number;
18066 /**
18067 * The alpha value starting from the top-left of the Game Object.
18068 * This value is interpolated from the corner to the center of the Game Object.
18069 */
18070 alphaTopLeft: number;
18071 /**
18072 * The alpha value starting from the top-right of the Game Object.
18073 * This value is interpolated from the corner to the center of the Game Object.
18074 */
18075 alphaTopRight: number;
18076 /**
18077 * The alpha value starting from the bottom-left of the Game Object.
18078 * This value is interpolated from the corner to the center of the Game Object.
18079 */
18080 alphaBottomLeft: number;
18081 /**
18082 * The alpha value starting from the bottom-right of the Game Object.
18083 * This value is interpolated from the corner to the center of the Game Object.
18084 */
18085 alphaBottomRight: number;
18086 }
18087
18088 /**
18089 * Provides methods used for setting the alpha property of a Game Object.

Callers 11

Layer.jsFile · 0.65
Alpha.test.jsFile · 0.65
TextureManager.jsFile · 0.65
Key.jsFile · 0.65
ContainerWebGLRendererFunction · 0.65
ContainerCanvasRendererFunction · 0.65
AlphaSingle.jsFile · 0.65
Alpha.jsFile · 0.65
LayerWebGLRendererFunction · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…