StaticaddRegister new extensions with PixiJS. Extensions can be registered in multiple formats:
extension propertyExtensions to add to PixiJS. Each can be:
extension propertytype and refThis extensions instance for chaining
Register new extensions with PixiJS. Extensions can be registered in multiple formats:
extension propertyExtensions to add to PixiJS. Each can be:
extension propertytype and refThis extensions instance for chaining
// Register a simple extension
extensions.add(MyRendererPlugin);
// Register multiple extensions
extensions.add(
MyRendererPlugin,
MySystemPlugin,
});
Mixin the source object(s) properties into the target class's prototype. Copies all property descriptors from source objects to the target's prototype.
The target class to mix properties into
One or more source objects containing properties to mix in
// Create a mixin with shared properties
const moveable = {
x: 0,
y: 0,
move(x: number, y: number) {
this.x += x;
this.y += y;
}
};
// Create a mixin with computed properties
const scalable = {
scale: 1,
get scaled() {
return this.scale > 1;
}
};
// Apply mixins to a class
extensions.mixin(Sprite, moveable, scalable);
// Use mixed-in properties
const sprite = new Sprite();
sprite.move(10, 20);
console.log(sprite.x, sprite.y); // 10, 20
Remove extensions from PixiJS.
Extensions to be removed. Can be:
extension propertytype and refthis for chaining
// Remove a single extension
extensions.remove(MyRendererPlugin);
// Remove multiple extensions
extensions.remove(
MyRendererPlugin,
MySystemPlugin
);
// Register a simple extension
extensions.add(MyRendererPlugin);
// Register multiple extensions
extensions.add(
MyRendererPlugin,
MySystemPlugin,
});
StaticmixinMixin the source object(s) properties into the target class's prototype. Copies all property descriptors from source objects to the target's prototype.
The target class to mix properties into
One or more source objects containing properties to mix in
// Create a mixin with shared properties
const moveable = {
x: 0,
y: 0,
move(x: number, y: number) {
this.x += x;
this.y += y;
}
};
// Create a mixin with computed properties
const scalable = {
scale: 1,
get scaled() {
return this.scale > 1;
}
};
// Apply mixins to a class
extensions.mixin(Sprite, moveable, scalable);
// Use mixed-in properties
const sprite = new Sprite();
sprite.move(10, 20);
console.log(sprite.x, sprite.y); // 10, 20
StaticremoveRemove extensions from PixiJS.
Extensions to be removed. Can be:
extension propertytype and refthis for chaining
Register new extensions with PixiJS. Extensions can be registered in multiple formats:
extension propertyExtensions to add to PixiJS. Each can be:
extension propertytype and refThis extensions instance for chaining
// Register a simple extension
extensions.add(MyRendererPlugin);
// Register multiple extensions
extensions.add(
MyRendererPlugin,
MySystemPlugin,
});
Mixin the source object(s) properties into the target class's prototype. Copies all property descriptors from source objects to the target's prototype.
The target class to mix properties into
One or more source objects containing properties to mix in
// Create a mixin with shared properties
const moveable = {
x: 0,
y: 0,
move(x: number, y: number) {
this.x += x;
this.y += y;
}
};
// Create a mixin with computed properties
const scalable = {
scale: 1,
get scaled() {
return this.scale > 1;
}
};
// Apply mixins to a class
extensions.mixin(Sprite, moveable, scalable);
// Use mixed-in properties
const sprite = new Sprite();
sprite.move(10, 20);
console.log(sprite.x, sprite.y); // 10, 20
Remove extensions from PixiJS.
Extensions to be removed. Can be:
extension propertytype and refthis for chaining
// Remove a single extension
extensions.remove(MyRendererPlugin);
// Remove multiple extensions
extensions.remove(
MyRendererPlugin,
MySystemPlugin
);
// Remove a single extension
extensions.remove(MyRendererPlugin);
// Remove multiple extensions
extensions.remove(
MyRendererPlugin,
MySystemPlugin
);
Global registration system for all PixiJS extensions. Provides a centralized way to add, remove, and manage functionality across the engine.
Features:
Example
Remarks
See