pixi-glyphs 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/pixi-glyphs.js +8 -6
- package/dist/pixi-glyphs.js.map +1 -1
- package/dist/pixi-glyphs.m.js +8 -6
- package/dist/pixi-glyphs.m.js.map +1 -1
- package/dist/pixi-glyphs.modern.js +10 -8
- package/dist/pixi-glyphs.modern.js.map +1 -1
- package/dist/pixi-glyphs.umd.js +8 -6
- package/dist/pixi-glyphs.umd.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
`Glyphs` is a multi-style text component for [pixi.js](https://github.com/GoodBoyDigital/pixi.js) that supports multiple `TextStyle`s using HTML-like tags. Includes many additional features not found in `PIXI.Text` such as embedded images (sprites), underlines, justified layout, and more.
|
|
6
6
|
|
|
7
|
-
Inspired by the original [pixi-multistyle-text](https://github.com/tleunen/pixi-multistyle-text) and is the spiritual successor to [pixi-tagged-text](https://github.com/mimshwright/pixi-tagged-text).
|
|
7
|
+
Inspired by the original [pixi-multistyle-text](https://github.com/tleunen/pixi-multistyle-text) and is the spiritual successor to [pixi-tagged-text](https://github.com/mimshwright/pixi-tagged-text). The difference in pixi-glyphs vs pixi-tagged-text is that pixi-glyphs is designed from the ground up for Pixi 8, whereas pixi-tagged-text was built for Pixi 6.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
package/dist/pixi-glyphs.js
CHANGED
|
@@ -1639,7 +1639,7 @@ class Glyphs extends PIXI__namespace.Container {
|
|
|
1639
1639
|
error = e;
|
|
1640
1640
|
console.log(error);
|
|
1641
1641
|
}
|
|
1642
|
-
if (isSpriteSource(spriteSource) && spriteSource.
|
|
1642
|
+
if (isSpriteSource(spriteSource) && spriteSource.source === null || sprite !== undefined && (sprite.destroyed || sprite.texture?.source === null)) {
|
|
1643
1643
|
error = destroyedError;
|
|
1644
1644
|
console.log(error);
|
|
1645
1645
|
}
|
|
@@ -1647,11 +1647,13 @@ class Glyphs extends PIXI__namespace.Container {
|
|
|
1647
1647
|
throw error;
|
|
1648
1648
|
}
|
|
1649
1649
|
const texture = sprite.texture;
|
|
1650
|
-
const onTextureUpdate =
|
|
1651
|
-
this.onImageTextureUpdate(
|
|
1652
|
-
|
|
1650
|
+
const onTextureUpdate = () => {
|
|
1651
|
+
this.onImageTextureUpdate(texture);
|
|
1652
|
+
texture.source.removeListener("update", onTextureUpdate);
|
|
1653
1653
|
};
|
|
1654
|
-
texture.
|
|
1654
|
+
if (texture.source) {
|
|
1655
|
+
texture.source.addListener("update", onTextureUpdate);
|
|
1656
|
+
}
|
|
1655
1657
|
this.spriteTemplates[key] = sprite;
|
|
1656
1658
|
const existingStyle = this.getStyleForTag(key) ?? {};
|
|
1657
1659
|
const style = {
|
|
@@ -1661,7 +1663,7 @@ class Glyphs extends PIXI__namespace.Container {
|
|
|
1661
1663
|
this.setStyleForTag(key, style);
|
|
1662
1664
|
});
|
|
1663
1665
|
}
|
|
1664
|
-
onImageTextureUpdate(
|
|
1666
|
+
onImageTextureUpdate(_texture) {
|
|
1665
1667
|
this._needsUpdate = true;
|
|
1666
1668
|
this._needsDraw = true;
|
|
1667
1669
|
this.updateIfShould();
|