Types.GameObjects.SpriteGPULayer
Member
<static> Member
| name | type | optional | description |
|---|---|---|---|
| x | number | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimation | No | The x position of the member. |
| y | number | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimation | No | The y position of the member. |
| rotation | number | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimation | No | The rotation of the member. |
| scaleX | number | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimation | No | The x scale of the member. |
| scaleY | number | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimation | No | The y scale of the member. |
| originX | number | No | The X pivot of the frame. Default 0.5, in the range 0 to 1 across the frame. If the frame has a custom pivot, it will offset this value. |
| originY | number | No | The Y pivot of the frame. Default 0.5, in the range 0 to 1 across the frame. If the frame has a custom pivot, it will offset this value. |
| tintFill | boolean | No | Whether the member should be filled with the tint color. If false, the member texture will be multiplied by the tint. If true, the member will use the texture alpha and the tint color. |
| creationTime | number | No | The time the member was created. This is measured from the initialization of layer.timeElapsed. Use this to control members added after the layer was created. |
| scrollFactorX | number | No | The horizontal camera scroll factor of the member. |
| scrollFactorY | number | No | The vertical camera scroll factor y of the member. |
| frame | string | number | Object | No |
| animation | string | number | Yes | The animation to use. If not set, the member will use frame as a static texture. |
| tintBlend | number | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimation | No | The tint blend mode of the member. 0 is no tint (equivalent to white), 1 is full tint. Use this to animate tint values, which are otherwise too complex to animate. |
| tintBottomLeft | number | No | The bottom-left tint color of the member, as a 24-bit RGB value. |
| tintTopLeft | number | No | The top-left tint color of the member, as a 24-bit RGB value. |
| tintBottomRight | number | No | The bottom-right tint color of the member, as a 24-bit RGB value. |
| tintTopRight | number | No | The top-right tint color of the member, as a 24-bit RGB value. |
| alphaBottomLeft | number | No | The bottom-left alpha value of the member, in the range 0-1. |
| alphaTopLeft | number | No | The top-left alpha value of the member, in the range 0-1. |
| alphaBottomRight | number | No | The bottom-right alpha value of the member, in the range 0-1. |
| alphaTopRight | number | No | The top-right alpha value of the member, in the range 0-1. |
| alpha | number | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimation | No | The alpha value of the member, in the range 0-1. This multiplies all four corner alpha values, and can be animated. |
Type: object
Member of: Phaser.Types.GameObjects.SpriteGPULayer
Source: src/gameobjects/spritegpulayer/typedefs/Member.js#L1
Since: 4.0.0
MemberAnimation
<static> MemberAnimation
| name | type | optional | default | description |
|---|---|---|---|---|
| base | number | Yes | 0 | The base value of the animation. |
| ease | number | string | Yes | 0 | The ease value of the animation. This must be a key or value of SpriteGPULayer.EASE, e.g. 'Linear', 'Quad.easeIn', etc. |
| amplitude | number | Yes | 0 | The amplitude of the animation. |
| duration | number | Yes | 0 | The duration of the animation, in milliseconds. Must be non-negative. |
| delay | number | Yes | 0 | The delay of the animation, in milliseconds. |
| loop | boolean | Yes | true | Whether the animation loops from 0-1 (optionally using yoyo from 0-1-1), or continues beyond 1. Non-looping animations can be useful for one-off particle effects. |
| yoyo | boolean | Yes | true | Whether the animation runs backwards when it completes. If false, it starts over from the beginning. |
| gravityFactor | number | Yes | 1 | The gravity factor of the animation. This is used instead of amplitude if the ease is 'Gravity'. |
| velocity | number | Yes | 0 | The velocity of the animation. Must be an integer. This is used instead of amplitude if the ease is 'Gravity'. |
Type: object
Member of: Phaser.Types.GameObjects.SpriteGPULayer
Source: src/gameobjects/spritegpulayer/typedefs/MemberAnimation.js#L1
Since: 4.0.0
SetAnimation
<static> SetAnimation
| name | type | optional | description |
|---|---|---|---|
| name | string | No | The name of the animation. |
| frames | Array.<number> | Array.<string> | No | An array containing the frames of the animation. |
| duration | number | No | The duration of the animation, in milliseconds. Must be non-negative. |
Type: object
Member of: Phaser.Types.GameObjects.SpriteGPULayer
Source: src/gameobjects/spritegpulayer/typedefs/SetAnimation.js#L1
Since: 4.0.0
SpriteGPULayerConfig
<static> SpriteGPULayerConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| size | number | No | The size of the SpriteGPULayer; the number of quads reserved in memory. This can be increased later. | |
| key | string | Phaser.Textures.Texture | Yes | The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. | |
| alpha | number | Yes | 1 | The alpha (opacity) of the Game Object. |
| blendMode | number | Yes | "BlendModes.DEFAULT" | The blend mode of the GameObject. |
| visible | boolean | Yes | true | The visible state of the Game Object. |
Type: object
Member of: Phaser.Types.GameObjects.SpriteGPULayer
Source: src/gameobjects/spritegpulayer/typedefs/SpriteGPULayerConfig.js#L1
Since: 4.0.0