Skip to main content
Version: Phaser v4.0.0-rc.6

Types.GameObjects.SpriteGPULayer

Member

<static> Member

nametypeoptionaldescription
xnumber | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimationNoThe x position of the member.
ynumber | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimationNoThe y position of the member.
rotationnumber | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimationNoThe rotation of the member.
scaleXnumber | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimationNoThe x scale of the member.
scaleYnumber | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimationNoThe y scale of the member.
originXnumberNoThe 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.
originYnumberNoThe 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.
tintFillbooleanNoWhether 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.
creationTimenumberNoThe 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.
scrollFactorXnumberNoThe horizontal camera scroll factor of the member.
scrollFactorYnumberNoThe vertical camera scroll factor y of the member.
framestring | numberObjectNo
animationstring | numberYesThe animation to use. If not set, the member will use frame as a static texture.
tintBlendnumber | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimationNoThe 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.
tintBottomLeftnumberNoThe bottom-left tint color of the member, as a 24-bit RGB value.
tintTopLeftnumberNoThe top-left tint color of the member, as a 24-bit RGB value.
tintBottomRightnumberNoThe bottom-right tint color of the member, as a 24-bit RGB value.
tintTopRightnumberNoThe top-right tint color of the member, as a 24-bit RGB value.
alphaBottomLeftnumberNoThe bottom-left alpha value of the member, in the range 0-1.
alphaTopLeftnumberNoThe top-left alpha value of the member, in the range 0-1.
alphaBottomRightnumberNoThe bottom-right alpha value of the member, in the range 0-1.
alphaTopRightnumberNoThe top-right alpha value of the member, in the range 0-1.
alphanumber | Phaser.Types.GameObjects.SpriteGPULayer.MemberAnimationNoThe 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

nametypeoptionaldefaultdescription
basenumberYes0The base value of the animation.
easenumber | stringYes0The ease value of the animation. This must be a key or value of SpriteGPULayer.EASE, e.g. 'Linear', 'Quad.easeIn', etc.
amplitudenumberYes0The amplitude of the animation.
durationnumberYes0The duration of the animation, in milliseconds. Must be non-negative.
delaynumberYes0The delay of the animation, in milliseconds.
loopbooleanYestrueWhether 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.
yoyobooleanYestrueWhether the animation runs backwards when it completes. If false, it starts over from the beginning.
gravityFactornumberYes1The gravity factor of the animation. This is used instead of amplitude if the ease is 'Gravity'.
velocitynumberYes0The 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

nametypeoptionaldescription
namestringNoThe name of the animation.
framesArray.<number> | Array.<string>NoAn array containing the frames of the animation.
durationnumberNoThe 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

nametypeoptionaldefaultdescription
sizenumberNoThe size of the SpriteGPULayer; the number of quads reserved in memory. This can be increased later.
keystring | Phaser.Textures.TextureYesThe key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager.
alphanumberYes1The alpha (opacity) of the Game Object.
blendModenumberYes"BlendModes.DEFAULT"The blend mode of the GameObject.
visiblebooleanYestrueThe 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