Skip to main content

v6 迁移指南


PixiJS 6 带来了一些表面层面的突破性变化。 本文件为 不完整

英:PixiJS 6 comes with few surface-level breaking changes. This document is not complete.

打字

如果你使用的是 TypeScript,请确保将以下内容添加到你的 tsconfig.json 中:

英:If you're using TypeScript, make sure the follow is added to your tsconfig.json:

{
"compilerOptions": {
"moduleResolution": "node",
// Required for importing 3rd-party dependencies like EventEmitter3
"esModuleInterop": true
}
}

网状内部结构

如果你曾经覆盖 Mesh._renderDefault 以考虑更多这样的制服: v5 参考

英:If you ever overrode Mesh._renderDefault to take into account more uniforms like this: v5 Reference

if (shader.program.uniformData.translationMatrix)
{
shader.uniforms.translationMatrix = this.transform.worldTransform.toArray(true);
}

删除 if,保留内容,否则你可能无法获得 translationMatrix 的正确同步统一,甚至更糟 - 获得空指针。 v6 参考

英:Remove the if, leave the contents, otherwise you might not get correct sync uniform for translationMatrix, or even worse - get null pointer. v6 Reference.

shader.uniforms.translationMatrix = this.transform.worldTransform.toArray(true);