index.rst 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .. include:: ../_header.rst
  2. .. highlight:: javascript
  3. Scene Editor
  4. ------------
  5. .. toctree::
  6. :maxdepth: 1
  7. create-new-scene-file
  8. add-object
  9. inspector-view
  10. game-objects
  11. scene-properties
  12. arcade-physics
  13. sprite-animations
  14. spine-animations
  15. shader-effects
  16. working-with-parent-objects
  17. object-list
  18. input
  19. prefabs
  20. script-node
  21. user-components
  22. manipulation-tools
  23. layout-tools
  24. scene-compiler
  25. misc
  26. troubleshooting
  27. The |SceneEditor|_ is the most important editor of the IDE, it provides the visual tools to create scenes (or levels).
  28. .. image:: ../images/scene-editor-04102020.webp
  29. :alt: Scene Editor screenshot.
  30. The |SceneEditor|_ is similar to other scene maker tools. The most peculiar characteristic is that this editor `compiles the scene <scene-compiler.html>`_ into readable Phaser_ code.
  31. Phaser_ provides support for certain file formats like the |AssetPackFile|_ (edited by the |AssetPackEditor|_), but it lacks a full-feature Scene file format suitable for level editors. Maybe it should be that way because Phaser_ is a framework and you may use it in very different ways and very different contexts.
  32. How can we develop a scene editor? We know we need to save the scene in a custom format. We have two main options:
  33. #. We can create a custom runtime, or plugin, to load the scene files in the game and create the objects in the fly.
  34. #. We can create a scene compiler, that translates the scene data file into Phaser_ code.
  35. The second option plays much better with the |PhaserEditor|_ philosophy of being fully compatible with a vanilla Phaser_ runtime. So this compiler gets a scene data file (``.scene``) and generates a clean, readable, hand-writing-like Phaser_ code. Even this option has other advantages: it is very easy to debug the scene and knowing exactly how the objects are created and modified.
  36. In previous desktop-based versions of |PhaserEditor|_, the |SceneEditor|_ used a custom renderer to build the scene. This render was based on desktop UI toolkits. In this version, we use Phaser_ and the browser to render the scene in the editor. It is a huge advantage, now what you see in the |SceneEditor|_ is what you get in the game.
  37. This chapter covers in-depth the |SceneEditor|_ tools and concepts, if you want a quick tutorial to create a scene, read the `First steps chapter <../first-steps/index.html>`_.