PixiJS不是什么
While PixiJS can do many things, there are things it can’t do, or that require additional tools to accomplish. Newcomers to PixiJS often struggle to identify which tasks PixiJS can solve, and which require outside solutions. If you’re about to start a project, it can be helpful to know if PixiJS is a good fit for your needs. The following list is obviously incomplete - PixiJS is also not, for example, a duck - but it includes many common tasks or features that you might expect us to support.
虽然PixiJS可以做很多事情,但有些事情是它做不到的,或者需要额外的工具来完成。新手经常难以确定哪些任务是精灵可以解决的,哪些需要外部解决方案。如果您即将开始一个项目,了解PixiJS是否适合您的需要会很有帮助。下面的列表并不完整,但它包含了许多您可能希望我们支持的常见任务或特性。
PixiJS 不是一个框架
PixiJS is a rendering engine, and it supports additional features such as interaction management that are commonly needed when using a render engine. But it is not a framework like Unity or Phaser. Frameworks are designed to do all the things you’d need to do when building a game - user settings management, music playback, object scripting, art pipeline management… the list goes on. PixiJS is designed to do one thing really well - render graphical content. This lets us focus on keeping up with new technology, and makes downloading PixiJS blazingly fast.
PixiJS是一个渲染引擎,它支持其他功能,例如使用渲染引擎时通常需要的交互管理。但是他并不像 Unity 和 Phaser 一样是一个框架。框架设计用于完成构建游戏时需要做的所有事情—用户设置管理、音乐播放、对象脚本、艺术管道管理。。。等等等。PixiJS的设计目的是很好地完成一件事——渲染图形内容。这让我们能够专注于跟上新技术的发展,并使下载PixiJS的速度极快。
3D渲染器
PixiJS is built for 2D. Platformers, adventure games, interactive ads, custom data visualization… all good. But if you want to render 3D models, you might want to check out babylon.js or three.js.
PixiJS是为2D构建的。平台,冒险游戏,互动广告,自定义数据可视化。。。一切都很好。但如果你想渲染3D模型,你可能需要看看 babylon.js 或者 three.js。
手机应用
If you’re looking to build mobile games, you can do it with PixiJS, but you’ll need to use a deployment system like Apache Cordova if you want access to native bindings. We don’t provide access to the camera, location services, notifications, etc.
如果您希望构建移动游戏,可以使用PixiJS,但如果您想要访问本机绑定,则需要使用Apache Cordova之类的部署系统。我们不提供摄像头、定位服务、通知等。
UI库
Building a truly generic UI system is a huge challenge, as anyone who has worked with Unity’s UI tools can attest. We’ve chosen to avoid the complexity to stay true to our core focus on speed. While you can certainly build your own UI using PixiJS’s scene graph and interaction manager, we don’t ship with a UI library out of the box.
构建一个真正通用的UI系统是一个巨大的挑战,任何使用过Unity UI工具的人都可以证明这一点。我们选择避免复杂性,以保持对速度的核心关注。虽然您当然可以使用PixiJS的场景图和交互管理器构建自己的UI,但我们并没有提供现成的UI库。
数据存储
There are many techniques and technologies that you can use to store settings, scores, and other data. Cookies, Web Storage, server-based storage… there are many solutions, each with advantages and disadvantages. You can use any of them with PixiJS, but we don’t provide tools to do so.
您可以使用许多技术来存储设置、分数和其他数据。Cookie、Web存储、基于服务器的存储。。。有很多解决方案,每个都有优点和缺点。您可以将它们中的任何一个用于PIXIJ,但我们不提供这样做的工具。
Audio 库
At least, not out of the box. Again, web audio technology is a constantly evolving challenge, with constantly changing rules and requirements across many browsers. There are a number of dedicated web audio libraries (such as Howler.js that can be used with PixiJS to play sound effects and music. Alternatively, the PixiJS Sound plugin is designed to work well with PixiJS.
至少,不是现成的。同样,网络音频技术是一个不断发展的挑战,许多浏览器的规则和要求都在不断变化。有许多专用的web音频库,如 Howler.js,可与PixiJS一起使用以播放音效和音乐。此外,PixiJS Sound plugin 设计用于与PixiJS配合使用。
开发环境
There are a number of tools that are useful for building 2D art and games that you might expect to be a part of PixiJS, but we’re a rendering engine, not a development environment. Packing sprite sheets, processing images, building mipmaps or Retina-ready sprites - there are great standalone tools for this type of tooling. Where appropriate throughout the guides, we’ll point you to tools that may be useful.
有许多工具对于构建2D艺术和游戏非常有用,您可能希望它们成为PixiJS的一部分,但我们是一个渲染引擎,而不是开发环境。打包精灵表单、处理图像、构建mipmaps或视网膜就绪精灵——这类工具有很好的独立工具。在整个指南中适当的地方,我们将为您指出可能有用的工具。
PixiJS 适合我么?
Only you know! If you’re looking for a tightly focused, fast and efficient rendering engine for your next web-based project, PixiJS is likely a great fit.
If you need a full game development framework, with native bindings and a rich UI library, you may want to explore other options.
Or you may not. It can be faster and easier to build just the subset of a full framework that your project needs than it can be to digest a monolithic API with bells and whistles you don’t need. There are hundreds of complex, rich games and visual projects that use PixiJS for rendering, with plugins or custom code to add the UI and sound effects. There are benefits to both approaches. Regardless, we hope you have a better feel for what PixiJS can (and cannot!) offer your project.
你懂的!如果您正在为下一个基于web的项目寻找一个聚焦紧密、快速高效的渲染引擎,那么PixiJS可能非常适合。
如果您需要一个完整的游戏开发框架、本机绑定和丰富的UI库,那么您可能需要探索其他选项。
当然你或许不需要,毕竟如果仅创建你项目需要的完整框架的子集比你去消化一大堆你并不需要的API要容易和快速的多。有数百种复杂、丰富的游戏和视觉项目使用PixiJS进行渲染,使用插件或自定义代码添加UI和音效。这两种方法都有好处。无论如何,我们都希望你能更好地理解 PixiJS 能干什么不能干什么,以便用到你的项目里。