PixiJS 更新 - v8.7.0
我们很高兴地宣布 PixiJS v8.7.0 的发布,它包含了许多你一直在要求的新功能和改进。此版本包括:
🌐 We're happy to announce the release of PixiJS v8.7.0, featuring a number of new features and improvements that you have been asking for. This version includes:
- 渲染层:独立于场景图层级控制对象的渲染顺序。
- GIF 支持:加载和操作带有播放控制的动画 GIF。
- Three.js 集成:简化在同一个项目中使用 PixiJS 和 Three.js(以及其他 WebGL 项目)。
这里更详细地看看这些功能及其提供的内容。
🌐 Here's a closer look at these features and what they offer.
让我们仔细看看这些新功能和改进。
🌐 Let's take a closer look at these new features and improvements.
渲染图层
🌐 Render Layers
The Render Layers API is experimental and may change in future releases.
渲染层让你可以更好地控制对象的渲染顺序,而无需更改它们的逻辑层级。
🌐 Render Layers give you more control over the rendering order of objects, without requiring changes to their logical hierarchy.
此功能适用于:
🌐 This feature is useful for:
- 将像生命值条或分数计数器这样的 UI 元素保持在其他对象之上。
- 在复杂场景中管理对象渲染。
- 在教程或覆盖层中高亮元素。
例如,你可以使用渲染层来确保UI生命值条始终显示在移动角色的上方,而不管场景图的层级结构如何。
🌐 For example, you can use Render Layers to ensure a UI health bar stays on top of a moving character, regardless of the scene graph hierarchy.
更多详细信息请参见 渲染图层指南。
🌐 More details are available in the Render Layers guide.
PixiJS 的老用户可能还记得 layers 插件,它提供了类似的功能。渲染层是一个更为集成且高性能的解决方案,直接内置于 PixiJS 的核心中。
🌐 Older users of PixiJS may remember the layers plugin, which provided similar functionality. Render Layers are a more integrated and performant solution that is built directly into the core of PixiJS.
GIF 支持
🌐 GIF Support
PixiJS 现在支持动画 GIF,为开发者提供以下功能:
🌐 PixiJS now supports animated GIFs, offering developers the ability to:
- 播放、停止或循环 GIF。
- 调整播放速度。
- 以编程方式跳转到特定帧。
此功能非常适合向你的项目添加动态动画元素。
🌐 This feature is ideal for adding dynamic animated elements to your projects.
你可以在 GIF API 文档 中找到完整的 API 详情。
🌐 You can find the full API details in the GIF API Documentation.
与 three.js(以及其他 WebGL 项目)集成
🌐 Integrating with three.js (and other WebGL projects)
由于共享 WebGL 上下文支持的改进,将 PixiJS 与 Three.js(以及其他 WebGL 项目)集成现在更容易了。这使得将 PixiJS 的 2D 功能与 Three.js 的 3D 渲染结合起来更加直接。
🌐 Integrating PixiJS with Three.js (and other WebGL projects) is now easier, thanks to improvements in shared WebGL context support. This makes it more straightforward to combine PixiJS's 2D capabilities with Three.js's 3D rendering.
详细指南可在这里获取。
🌐 A detailed guide is available here.
额外更新
🌐 Additional Updates
此次发布还包括各种改进和错误修复。有关完整的更改列表,请查看 更新日志。
🌐 This release also includes various improvements and bug fixes. For a complete list of changes, check out the changelog.
结论
🌐 Conclusion
我们鼓励你尝试这些新功能并分享你的反馈。你可以通过 Discord 与我们联系,或开启一个 讨论。
🌐 We encourage you to try out these new features and share your feedback. You can connect with us on Discord or start a discussion.
感谢你使用 PixiJS,我们期待看到你使用 v8.7.0 创作的作品。
🌐 Thank you for using PixiJS, and we look forward to seeing what you create with v8.7.0.
