Skip to main content
Version: Phaser v4.1.0

Textures

CLAMP_TO_EDGE​

CLAMP_TO_EDGE: number​

Description:

Clamp to edge wrap mode. UV coordinates outside the [0, 1] range are clamped to the nearest edge of the texture. This stretches the edge pixels outward rather than repeating the texture, and is the default wrap mode for most textures in Phaser.

Source: src/textures/const-wrap.js#L20
Since: 4.0.0

REPEAT​

REPEAT: number​

Description:

Repeat wrap mode. The texture tiles seamlessly in both directions when UV coordinates exceed the [0, 1] range. Useful for repeating background patterns or tiling surfaces. Note that the texture dimensions must be powers of two for this mode to work correctly in WebGL.

Source: src/textures/const-wrap.js#L33
Since: 4.0.0

MIRRORED_REPEAT​

MIRRORED_REPEAT: number​

Description:

Mirrored repeat wrap mode. Similar to REPEAT, but the texture is flipped (mirrored) on each repetition. For example, a texture spanning UV 0–1 will appear mirrored from 1–2, normal from 2–3, and so on. This can produce smoother-looking tiling by eliminating visible seams at tile boundaries.

Source: src/textures/const-wrap.js#L46
Since: 4.0.0

LINEAR​

LINEAR: number​

Description:

Linear (bilinear) filter type. Smooths textures by interpolating between neighbouring pixels when scaling, producing a blended, anti-aliased result. Suitable for high-resolution artwork but will appear blurry on pixel art.

Source: src/textures/const.js#L18
Since: 3.0.0

NEAREST​

NEAREST: number​

Description:

Nearest neighbor filter type. Samples the single closest pixel when scaling, preserving hard edges and producing a crisp, blocky result. Ideal for pixel art games where texture sharpness is important.

Source: src/textures/const.js#L29
Since: 3.0.0

LINEAR​

LINEAR: number​

Description:

Linear filter type.

Source: src/textures/index.js#L15
Since: 3.0.0

NEAREST​

NEAREST: number​

Description:

Nearest Neighbor filter type.

Source: src/textures/index.js#L24
Since: 3.0.0