install-core.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. .. include:: ../_header.rst
  2. .. highlight:: bash
  3. Install Phaser Editor 2D Core
  4. =============================
  5. You can install |core|_ using two main methods:
  6. - Download it from the Phaser Editor 2D website.
  7. - Install it using the Node Package Manager (NPM)
  8. Getting Phaser Editor 2D Core from the Phaser Editor 2D website
  9. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. Download the ``PhaserEditor2D-core-<version>-<platform>.zip`` file for your platform from the `Downloads page <https://phasereditor2d.com/downloads>`_.
  11. Un-compress the downloaded file, open the terminal and run:
  12. .. code::
  13. $ cd /path/to/downloaded/PhaserEditor2D
  14. $ ./PhaserEditor2D -project path/to/project
  15. The server starts and opens the default browser in the address: ``http://127.0.0.1:1959/editor``.
  16. The ``-project`` flag is mandatory, its value must be the path to the game project.
  17. Check the `Create your first project <create-first-project.html>`_ section for creating a new game.
  18. .. warning::
  19. In previous versions of the editor, there was the workspace concept. It allowed you to create new projects inside a workspace folder. It is not supported anymore, the editor's server only runs for a single project.
  20. By default, the server runs in application-mode. It means it does its best on providing better integration with your OS:
  21. * It opens the default browser at the right URL (you can change it with the ``-browser-command`` option).
  22. * It allows launching third-party OS applications like Visual Studio Code or the file manager (Windows Explorer, macOS Finder, etc...).
  23. * It denies remote connections.
  24. However, you can run the server in a remote host using the ``-public`` option:
  25. .. code::
  26. $ ./PhaserEditor2D -public
  27. It allows remote connections but disables all the OS integration described before.
  28. `Learn more about all the command line options <../misc/server-options.html>`_
  29. Getting Phaser Editor 2D Core from the NPM registry
  30. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  31. You can install |core|_ globally in your system using |npm|_:
  32. .. code::
  33. > npm install -g phasereditor2d-launcher
  34. And you can run it in a terminal:
  35. .. code::
  36. $ phasereditor2d-launcher -project path/to/project
  37. The `phasereditor2d-launcher <https://www.npmjs.com/package/phasereditor2d-launcher>`_ script downloads the latest |core|_ version from the Phaser Editor 2D website and runs it. Next time, the script will use the downloaded editor.
  38. However, probably you would like to install ``phasereditor2d-launcher`` as a dependency of your project. Then do:
  39. .. code::
  40. > npm install phasereditor2d-launcher --save-dev
  41. And run it:
  42. .. code::
  43. $ npx phasereditor2d-launcher -project .
  44. If your project was created using one of the project templates provided by the |allInOne|_ distribution or downloaded from the `Phaser Editor 2D Start page <https://phasereditor2d.com/start>`_, then the editor is installed together with the other dependencies. Also, the ``package.json`` file contains the ``editor`` script for running the editor:
  45. .. code::
  46. > npm run editor
  47. `Learn more about the phasereditor2d-launcher module <https://www.npmjs.com/package/phasereditor2d-launcher>`_.