LogoPixi’VN
pixi-jsClasses

Class: FillPattern

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:34

A class that represents a fill pattern for use in Text and Graphics fills. It allows for textures to be used as patterns, with optional repetition modes.

Standard

Example

const txt = await Assets.load('https://pixijs.com/assets/bg_scene_rotate.jpg');
const pat = new FillPattern(txt, 'repeat');

const textPattern = new Text({
    text: 'PixiJS',
    style: {
        fontSize: 36,
        fill: 0xffffff,
        stroke: { fill: pat, width: 10 },
    },
});

textPattern.y = (textGradient.height);

Implements

  • CanvasPattern

Constructors

Constructor

> new FillPattern(texture, repetition?): FillPattern

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:50

Parameters

texture

Texture

repetition?

PatternRepetition

Returns

FillPattern

Properties

_texture

> _texture: Texture

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:47

Internal


_tick

> _tick: number

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:45

Internal

Internal tick counter to track changes in the pattern. This is used to invalidate the pattern when the texture or transform changes.


transform

> transform: Matrix

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:49

The transform matrix applied to the pattern


uid

> readonly uid: number

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:39

Internal

unique id for this fill pattern

Accessors

styleKey

Get Signature

> get styleKey(): string

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:65

Returns a unique key for this instance. This key is used for caching.

Returns

string

Unique key for the instance


texture

Get Signature

> get texture(): Texture

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:58

Internal texture used to render the gradient

Returns

Texture

Set Signature

> set texture(value): void

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:59

Parameters
value

Texture

Returns

void

Methods

destroy()

> destroy(): void

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:67

Destroys the fill pattern, releasing resources. This will also destroy the internal texture.

Returns

void


setTransform()

> setTransform(transform?): void

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.d.ts:56

Sets the transform for the pattern

Parameters

transform?

Matrix

The transform matrix to apply to the pattern. If not provided, the pattern will use the default transform.

Returns

void

Implementation of

CanvasPattern.setTransform