This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Pixi v6 Deprecated methods #37
Comments
the problem is, typings were changed. a lot. We cant compile it with TS anymore. I can only modify resulting JS and publish it. Alternatively, I can move it to new build system like |
Also PixiJS v6 has compressed-textures internally, if you dont need my special kind of loader :) https://github.com/pixijs/pixi.js/tree/dev/packages/compressed-textures |
hi @ivanpopelyshev, vey cool it's all integrated now! mainTexture = fetch(
!darkMode
? await FileAttachment("final-100n-250-white-8192@1.basis").url()
: await FileAttachment("final-100n-250-black-8192.basis").url()
)
// .arrayBuffer() // FileAttachment("final-basis-level-3.basis")
.then(d => d.blob())
.then(blob => blob.arrayBuffer())
.then(array => PIXI.compressedTextures.loadFromArrayBuffer(array))
.then(d => {
const texture = new PIXI.BaseTexture(d);
texture.scaleMode = PIXI.SCALE_MODES.NEAREST;
return texture;
}) |
finally spent some time on this and found a way to use the loader functions directly mainTexture = fetch(
!darkMode
? await FileAttachment("final-100n-250-white-8192@1.basis").url()
: await FileAttachment("final-100n-250-black-8192.basis").url()
)
.then((d) => d.blob())
.then((blob) => blob.arrayBuffer())
.then((array) => PIXI.BasisLoader.transcodeAsync(array))
.then((transcoded) => {
const e = PIXI.BasisLoader.registerTextures("mainTexture", transcoded);
return e.texture;
})
.then((texture) => {
texture.scaleMode = PIXI.SCALE_MODES.NEAREST;
return texture;
}) here is the final example! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'd be happy to submit a PR if that's the case.
PIXI.systems.Resource
-->PIXI.ResourceDeprecated
PIXI.resources.TextureSystem
-->PIXI.TextureSystemDeprecated
The text was updated successfully, but these errors were encountered: