Phaser API Documentation

  Version: 
Only webGL uvScroll(x, y)

Description:

Scrolls the UV texture coordinates of all faces in this Mesh by adding the given x/y amounts to them.

If you only wish to scroll one coordinate, pass a value of zero to the other.

Use small values for scrolling. UVs are set from the range 0 to 1, so you should increment (or decrement) them by suitably small values, such as 0.01.

Due to a limitation in WebGL1 you can only UV scroll textures that are a power-of-two in size. Scrolling NPOT textures will work but will result in clamping the pixels to the edges.

Note that if this Mesh is using a frame from a texture atlas then you will be unable to UV scroll its texture.

Parameters:

name type description
x number

The amount to horizontally shift the UV coordinates by.

y number

The amount to vertically shift the UV coordinates by.

Returns:
Description:

This Game Object instance.

Since: 3.60.0