Move the export section to tutorials/

This commit is contained in:
Nathan Lovato
2020-10-10 22:33:25 -06:00
parent 3271002b9e
commit 5da94fcf78
58 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,50 @@
.. _doc_android_custom_build:
Custom builds for Android
=========================
Godot provides the option to use custom build Android templates. Instead of
using the already pre-built template that ships with Godot, an actual Android
Java project gets installed into your project folder. Godot will then build it
and use it as an export template every time you export the project.
There are some reasons why you may want to do this:
* Modify the project before it's built.
* Add external SDKs that build with your project.
Configuring the custom build is a fairly straightforward process. But first
you need to follow the steps in :ref:`exporting for android<doc_exporting_for_android>`
up to **Setting it up in Godot**. After doing that, follow the steps below.
Set up the custom build environment
-----------------------------------
Go to the Project menu, and install the *Custom Build* template:
.. image:: img/custom_build_install_template.png
Make sure export templates are downloaded. If not, this menu will help you
download them.
A Gradle-based Android project will be created under ``res://android/build``.
Editing these files is not needed unless you want to :ref:`create
your own add-ons<doc_android_plugin>`, or you really need to modify the project.
Enabling the custom build and exporting
---------------------------------------
When setting up the Android project in the **Project > Export** dialog,
**Custom Build** needs to be enabled:
.. image:: img/custom_build_enable.png
From now on, attempting to export the project or one-click deploy will call the
`Gradle <https://gradle.org/>`__ build system to generate fresh templates (this
window will appear every time):
.. image:: img/custom_build_gradle.png
The templates built will be used automatically afterwards, so no further
configuration is needed.

View File

@@ -0,0 +1,117 @@
.. _doc_changing_application_icon_for_windows:
Changing application icon for Windows
=====================================
By default, the exported project's icon will be the Godot icon.
You will most likely want to change that for your project. There are two types
of icons that can be changed on Windows: the file icon and the taskbar icon.
Creating an ICO file
--------------------
Windows does not use formats such as png or jpg for application icons. Instead,
it uses a Windows-only format called ICO. You can create your application icon
in any program but you will have to convert it to an ICO file using a program such
as GIMP.
`This video tutorial <https://www.youtube.com/watch?v=uqV3UfM-n5Y>`_ goes over how to
export an ICO file with GIMP.
It is also possible to convert a PNG image to an hiDPI-friendly ICO file
using this `ImageMagick <https://www.imagemagick.org/>`_ command:
.. code-block:: none
magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
.. warning::
For the ICO file to effectively replace the default Godot icon, it must
contain *all* the sizes included in the default Godot icon: 16×16, 32×32,
48×48, 64×64, 128×128, 256×256. If the ICO file does not contain all the sizes,
the default Godot icon will be kept for the sizes that weren't overridden.
The above ImageMagick command takes this into account.
Changing the taskbar icon
-------------------------
The taskbar icon is the icon that shows up on the taskbar when your project
is running.
.. image:: img/icon_taskbar_icon.png
To change the taskbar icon, go to
**Project → Project Settings → Application → Config → Windows Native Icon**.
Click on the folder icon and select your ICO file.
.. image:: img/icon_project_settings.png
This setting only changes the icon for your exported game on Windows.
To set the icon for macOS, use ``Macos Native Icon``. And for any other platform,
use the ``Icon`` setting.
Changing the file icon
----------------------
.. warning::
There are `known issues <https://github.com/godotengine/godot/issues/33466>`__
when changing the application icon in executables that embed a PCK file.
It's recommended to avoid using rcedit for now if you choose to enable the
**Embed Pck** option for your Windows export preset in the Export dialog.
The file icon is the icon of the executable that you click on to start
the project.
.. image:: img/icon_file_icon.png
Before selecting it in the export options, you will need to install
an extra tool called **rcedit**.
You can download it `here <https://github.com/electron/rcedit/releases>`_.
After downloading, you need to tell Godot the path to the rcedit executable
on your computer.
Go to **Editor → Editor Settings → Export → Windows**.
Click on the folder icon for the **rcedit** entry.
Navigate to and select the rcedit executable.
.. note::
Linux and macOS users will also need to install
`WINE <https://www.winehq.org/>`_ to use rcedit.
.. image:: img/icon_rcedit.png
You should now have everything in place to change the file icon.
To do that, you will need to specify the icon when exporting.
Go to **Project → Export**. Assuming you have already created
a Windows Desktop preset, select your icon in ICO format in
the **Application → Icon** field.
.. image:: img/icon_export_settings.png
.. note::
If rcedit fails to change the icon, you can instead
:ref:`compile your own Windows export templates <doc_compiling_for_windows>`
with the icon changed. To do so, replace
`platform/windows/godot.ico <https://github.com/godotengine/godot/blob/master/platform/windows/godot.ico>`__
with your own ICO file *before* compiling export templates.
Once this is done, you can specify your export templates as custom export
templates in your project's Windows export preset.
Testing the result
------------------
You can now export the project. If it worked correctly, you should see this:
.. image:: img/icon_result.png
.. note::
If your icon isn't showing up properly, on Windows 10, try clearing the icon
cache. To do so, open the **Run** dialog and enter ``ie4uinit.exe
-ClearIconCache`` or ``ie4uinit.exe -show``.

View File

@@ -0,0 +1,164 @@
.. _doc_exporting_for_android:
Exporting for Android
=====================
Exporting for Android has fewer requirements than compiling Godot for Android.
The following steps detail what is needed to set up the Android SDK and the engine.
Download the Android SDK
------------------------
Download and install the Android SDK.
- You can install it using `Android Studio version 4.1 or later <https://developer.android.com/studio/>`__.
- Run it once to complete the SDK setup using these `instructions <https://developer.android.com/studio/intro/update#sdk-manager>`__.
- Ensure that the `required packages <https://developer.android.com/studio/intro/update#recommended>`__ are installed as well.
- Android SDK Platform-Tools version 30.0.5 or later
- Android SDK Build-Tools version 30.0.3
- Android SDK Platform 29
- Android SDK Command-line Tools (latest)
- CMake version 3.10.2.4988404
- NDK version 21.4.7075529
- You can install it using the `command line tools <https://developer.android.com/studio/#command-tools>`__.
- Once the command line tools are installed, run the `sdkmanager <https://developer.android.com/studio/command-line/sdkmanager>`__ command to complete the setup process:
::
sdkmanager --sdk_root=<android_sdk_path> "platform-tools" "build-tools;30.0.3" "platforms;android-29" "cmdline-tools;latest" "cmake;3.10.2.4988404" "ndk;21.4.7075529"
.. note::
If you are using Linux,
**do not use an Android SDK provided by your distribution's repositories as it will often be outdated**.
Install OpenJDK 11
------------------
Download and install `OpenJDK 11 <https://adoptium.net/?variant=openjdk11>`__.
Create a debug.keystore
-----------------------
Android needs a debug keystore file to install to devices and distribute
non-release APKs. If you have used the SDK before and have built
projects, ant or eclipse probably generated one for you (in the ``~/.android`` directory on Linux and
macOS, in the ``C:\Users\<user>\.android\`` directory on Windows).
If you can't find it or need to generate one, the keytool command from
the JDK can be used for this purpose::
keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -deststoretype pkcs12
This will create a ``debug.keystore`` file in your current directory. You should move it to a memorable location such as ``%USERPROFILE%\.android\``, because you will need its location in a later step. For more information on ``keytool`` usage, see `this Q&A article <https://godotengine.org/qa/21349/jdk-android-file-missing>`__.
Setting it up in Godot
----------------------
Enter the Editor Settings screen. This screen contains the editor
settings for the user account in the computer (it's independent of the
project).
.. image:: img/editorsettings.png
Scroll down to the section where the Android settings are located:
.. image:: img/androidsdk.png
In that screen, 2 paths need to be set:
- The ``Android Sdk Path`` should be the location where the Android SDK was installed.
- For example ``%LOCALAPPDATA%\Android\Sdk\`` on Windows or ``/Users/$USER/Library/Android/sdk/`` on macOS.
- The debug ``.keystore`` file
- It can be found in the folder where you put the ``debug.keystore`` file you created above.
Once that is configured, everything is ready to export to Android!
.. note::
If you get an error saying *"Could not install to device."*, make sure
you do not have an application with the same Android package name already
installed on the device (but signed with a different key).
If you have an application with the same Android package name but a
different signing key already installed on the device, you **must** remove
the application in question from the Android device before exporting to
Android again.
Providing launcher icons
------------------------
Launcher icons are used by Android launcher apps to represent your application to users. Godot only requires high-resolution icons (for ``xxxhdpi`` density screens) and will automatically generate lower-resolution variants.
There are two types of icons required by Godot:
- **Main Icon:** The "classic" icon. This will be used on all Android versions up to Android 8 (Oreo), exclusive. Must be at least 192×192 px.
- **Adaptive Icons:** Starting from Android 8 (inclusive), `Adaptive Icons <https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive>`_ were introduced. Applications will need to include separate background and foreground icons to have a native look. The user's launcher application will control the icon's animation and masking. Must be at least 432×432 px.
.. seealso:: It's important to adhere to some rules when designing adaptive icons. `Google Design has provided a nice article <https://medium.com/google-design/designing-adaptive-icons-515af294c783>`_ that helps to understand those rules and some of the capabilities of adaptive icons.
.. caution:: The most important adaptive icon design rule is to have your icon critical elements inside the safe zone: a centered circle with a diameter of 66dp (264 pixels on ``xxxhdpi``) to avoid being clipped by the launcher.
If you don't provide some of the requested icons, Godot will replace them using a fallback chain, trying the next in line when the current one fails:
- **Main Icon:** Provided main icon -> Project icon -> Default Godot main icon.
- **Adaptive Icon Foreground:** Provided foreground icon -> Provided main icon -> Project icon -> Default Godot foreground icon.
- **Adaptive Icon Background:** Provided background icon -> Default Godot background icon.
It's highly recommended to provide all the requested icons with their specified resolutions.
This way, your application will look great on all Android devices and versions.
Exporting for Google Play Store
-------------------------------
Uploading an APK to Google's Play Store requires you to sign using a non-debug
keystore file; such file can be generated like this:
.. code-block:: shell
keytool -v -genkey -keystore mygame.keystore -alias mygame -keyalg RSA -validity 10000
This keystore and key are used to verify your developer identity, remember the password and keep it in a safe place!
Use Google's Android Developer guides to learn more about `APK signing <https://developer.android.com/studio/publish/app-signing>`__.
Now fill in the following forms in your Android Export Presets:
.. image:: img/editor-export-presets-android.png
- **Release:** Enter the path to the keystore file you just generated.
- **Release User:** Replace with the key alias.
- **Release Password:** Key password. Note that the keystore password and the key password currently have to be the same.
**Your export_presets.cfg file now contains sensitive information.** If you use
a version control system, you should remove it from public repositories and add
it to your ``.gitignore`` file or equivalent.
Don't forget to uncheck the **Export With Debug** checkbox while exporting.
.. image:: img/export-with-debug-button.png
Optimizing the APK size
-----------------------
By default, the APK will contain native libraries for both ARMv7 and ARMv8
architectures. This increases its size significantly. To create a smaller APK,
uncheck either **Armeabi-v 7a** or **Arm 64 -v 8a** in your project's Android
export preset. This will create an APK that only contains a library for
a single architecture. Note that applications targeting ARMv7 can also run on
ARMv8 devices, but the opposite is not true.
Since August 2019, Google Play requires all applications to be available in
64-bit form. This means you cannot upload an APK that contains *just* an ARMv7
library. To solve this, you can upload several APKs to Google Play using its
`Multiple APK support <https://developer.android.com/google/play/publishing/multiple-apks>`__.
Each APK should target a single architecture; creating an APK for ARMv7
and ARMv8 is usually sufficient to cover most devices in use today.
You can optimize the size further by compiling an Android export template with
only the features you need. See :ref:`doc_optimizing_for_size` for more
information.

View File

@@ -0,0 +1,125 @@
.. _doc_exporting_for_dedicated_servers:
Exporting for dedicated servers
===============================
If you want to run a dedicated server for your project on a machine that doesn't
have a GPU or display server available, you'll need to use a server build of Godot.
Platform support
----------------
- **Linux:** `Download an official Linux server binary <https://godotengine.org/download/server>`__.
To compile a server binary from source, follow instructions in
:ref:`doc_compiling_for_x11`.
- **macOS:** :ref:`Compile a server binary from source for macOS <doc_compiling_for_osx>`.
- **Windows:** There is no dedicated server build for Windows yet. As an alternative,
you can use the ``--no-window`` command-line argument to prevent Godot from
spawning a window. Note that even with the ``--no-window`` command-line argument,
you'll need to have OpenGL support available on the Windows machine.
If your project uses C#, you'll have to use a Mono-enabled server binary.
"Headless" versus "server" binaries
-----------------------------------
The `server download page <https://godotengine.org/download/server>`__
offers two kinds of binaries with several differences.
- **Server:** Use this one for running dedicated servers. It does not contain
editor functionality, and is therefore smaller and more
optimized.
- **Headless:** This binary contains editor functionality and is intended to be
used for exporting projects. This binary *can* be used to run dedicated
servers, but it's not recommended as it's larger and less optimized.
Exporting a PCK file
--------------------
There are two ways to export a project for a server:
- Create a Linux/X11 export preset, define a custom Release export template
that points to the server binary then export the project as usual.
- Export a PCK file only, preferably from a Linux/X11 export preset.
Both methods should result in identical output. The text below describes the PCK
file approach.
Once you've downloaded a server binary, you should export a PCK file containing
your project data. After creating the export preset, click **Export PCK/ZIP** at
the bottom of the Export dialog then choose a destination path.
The **Export With Debug** checkbox in the file dialog has no bearing on the
final PCK file, so you can leave it as-is.
See :ref:`doc_exporting_projects` for more information.
.. note::
If you're exporting the project from a headless editor, call the headless
editor with the `--export-pack` option while in the project folder to export
only a PCK file.
.. note::
The PCK file will include resources not normally needed by the server, such
as textures and sounds. This means the PCK file will be larger than it could
possibly be. Support for stripping unneeded resources from a PCK for server
usage is planned in a future Godot release.
On the bright side, this allows the same PCK file to be used both by a
client and dedicated server build. This can be useful if you want to ship a
single archive that can be used both as a client and dedicated server.
Preparing the server distribution
---------------------------------
After downloading or compiling a server binary, you should now place it in the
same folder as the PCK file you've exported. The server binary should have the
same name as the PCK (excluding the extension). This lets Godot detect and use
the PCK file automatically. If you want to start a server with a PCK that has a
different name, you can specify the path to the PCK file using the
``--main-pack`` command-line argument::
./godot-server --main-pack my_project.pck
Starting the dedicated server
-----------------------------
If both your client and server are part of the same Godot project, you will have
to add a way to start the server directly using a command-line argument. This
can be done by adding the following code snippet in your main scene (or a
singleton)'s ``_ready()`` method::
if "--server" in OS.get_cmdline_args():
# Run your server startup code here...
# Using this check, you can start a dedicated server by running
# a Godot binary (headless or not) with the `--server` command-line argument.
pass
Alternatively, you can make the dedicated server always start up if a headless
or server binary is detected::
# Note: Feature tags are case-sensitive! It's "Server", not "server".
if OS.has_feature("Server"):
# Run your server startup code here...
# Note that using this check may break unit testing scripts when
# running them with headless or server binaries.
pass
If your client and server are separate Godot projects, your server should most
likely be configured in a way where running the main scene starts a server
automatically.
Next steps
----------
On Linux, to make your dedicated server restart after a crash or system reboot,
you can
`create a systemd service <https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6>`__.
This also lets you view server logs in a more convenient fashion, with automatic
log rotation provided by systemd.
If you have experience with containers, you could also look into wrapping your
dedicated server in a `Docker <https://www.docker.com/>`__ container. This way,
it can be used more easily in an automatic scaling setup (which is outside the
scope of this tutorial).

View File

@@ -0,0 +1,100 @@
.. _doc_exporting_for_ios:
Exporting for iOS
=================
These are the steps to load a Godot project in Xcode. This allows you to
build and deploy to an iOS device, build a release for the App Store, and
do everything else you can normally do with Xcode.
Requirements
------------
- You must export for iOS from a computer running macOS with Xcode installed.
- Download the Godot export templates. Use the Godot menu: Editor > Manage Export Templates
Export a Godot project to Xcode
-------------------------------
In the Godot editor, open the **Export** window from the **Project** menu. When the
Export window opens, click **Add..** and select **iOS**.
The following export options are required. Leaving any blank will cause the
exporter to throw an error:
* In the **Application** category
* **App Store Team ID** and (Bundle) **Identifier**
* Everything in the **Required Icons** category
* Everything in the **Landscape Launch Screens** category
* Everything in the **Portrait Launch Screens** category
After you click **Export Project**, there are still two important options left:
* **Path** is an empty folder that will contain the exported Xcode project files.
* **File** will be the name of the Xcode project and several project specific files and directories.
.. image:: img/ios_export_file.png
.. note:: This tutorial uses **exported_xcode_project_name**, but you will use your
project's name. When you see **exported_xcode_project_name**
in the following steps, replace it with the name you used instead.
.. note:: Avoid using spaces when you choose your **exported_xcode_project_name** as
this can lead to corruption in your XCode project file.
When the export completes, the output folder should look like this:
.. image:: img/ios_export_output.png
Opening **exported_xcode_project_name.xcodeproj** lets you build and deploy
like any other iOS app.
Active development considerations
---------------------------------
The above method creates an exported project that you can build for
release, but you have to re-export every time you make a change in Godot.
While developing, you can speed this process up by linking your
Godot project files directly into your app.
In the following example:
* **exported_xcode_project_name** is the name of the exported iOS application (as above).
* **godot_project_to_export** is the name of the Godot project.
.. note:: **godot_project_to_export** must not be the same as **exported_xcode_project_name**
to prevent signing issues in Xcode.
Steps to link a Godot project folder to Xcode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Start from an exported iOS project (follow the steps above).
2. In Finder, drag the Godot project folder into the Xcode file browser.
.. image:: img/ios_export_add_dir.png
3. In the dialog, make sure **Create folder references** is selected. This means
you will be able to continue to edit your Godot project in its current location.
.. image:: img/ios_export_file_ref.png
4. See the **godot_project_to_export** folder in the Xcode file browser.
5. Delete **exported_xcode_project_name.pck** from the Xcode project.
.. image:: img/ios_export_delete_pck.png
6. Open **exported_xcode_project_name-Info.plist** and add a string property named
**godot_path** (this is the real key name) with a value **godot_project_to_export**
(this is the name of your project)
.. image:: img/ios_export_set_path.png
That's it! You can now edit your project in the Godot editor and build it
in Xcode when you want to run it on a device.
Plugins for iOS
---------------
Special iOS plugins can be used in Godot. Check out the
:ref:`doc_plugins_for_ios` page.

View File

@@ -0,0 +1,24 @@
.. _doc_exporting_for_pc:
Exporting for PC
================
The simplest way to distribute a game for PC is to copy the executables
(``godot.exe`` on Windows, ``godot`` on the rest), compress the folder
and send it to someone else. However, this is often not desired.
Godot offers a more elegant approach for PC distribution when using the
export system. When exporting for PC (Linux, Windows, macOS), the exporter
takes all the project files and creates a ``data.pck`` file. This file is
bundled with a specially optimized binary that is smaller, faster and
does not contain the editor and debugger.
.. warning::
If you export for Windows with embedded PCK files, you will not be able to
sign the program as it will break.
On Windows, PCK embedding is also known to cause false positives in
antivirus programs. Therefore, it's recommended to avoid using it unless
you're distributing your project via Steam as it bypasses code signing and
antivirus checks.

View File

@@ -0,0 +1,96 @@
.. _doc_exporting_for_uwp:
Exporting for Universal Windows Platform
========================================
There's no extra requirement to export an ``.appx`` package that can be
installed as a Windows App or submitted to the Windows Store. Exporting UWP
packages also works from any platform, not only from Windows.
However, if you want to install and run the app, you need to sign it with a
trusted signature. Godot supports automatic signing of packages with
external tools.
Also, make sure the Publisher Name you set when exporting the package matches
the name used on the certificate.
Limitations on Xbox One
-----------------------
As described in the `UWP documentation <https://docs.microsoft.com/en-us/windows/uwp/xbox-apps/system-resource-allocation>`__:
- Submitted as an "App"
- available memory is 1GB
- share of 2-4 CPU cores
- shared access of GPU power (45%)
- Submitted as a "Game" (through `Xbox Live Creators Program <https://www.xbox.com/en-US/developers/creators-program>`__)
- available memory is 5GB
- 4 exclusive CPU cores and 2 shared CPU cores
- exclusive access to GPU power (100%)
- Exceeding these memory limitations will cause allocation failures and the application will crash.
Creating a signing certificate
------------------------------
This requires the ``MakeCert.exe`` and ``Pvk2Pfx.exe`` tools, which come with
the Windows SDK. If you use Visual Studio, you can open one of its Developer
Prompts, since it comes with these tools and they can be located in the path.
You can get more detailed instructions from `Microsoft's documentation
<https://msdn.microsoft.com/en-us/library/windows/desktop/jj835832(v=vs.85).aspx>`__.
First, run ``MakeCert`` to create a private key::
MakeCert /n publisherName /r /h 0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e expirationDate /sv MyKey.pvk MyKey.cer
Where ``publisherName`` matches the Publisher Name of your package and
``expirationDate`` is in the ``mm/dd/yyyy`` format.
Next, create a Personal Information Exchange (.pfx) file using ``Pvk2Pfx.exe``::
Pvk2Pfx /pvk MyKey.pvk /pi pvkPassword /spc MyKey.cer /pfx MyKey.pfx [/po pfxPassword]
If you don't specify a password with ``/po`` argument, the PFX will have the
same password as the private key.
You will also need to trust this certificate in order to be able to install your
app. Open the Command Prompt as Administrator and run the following command::
Certutil -addStore TrustedPeople MyKey.cer
Setting up automatic signing
----------------------------
To setup automatic signing on export you need to go to Editor Settings > Export > Uwp.
From there you need to click on the folder for ``Signtool``, and navigate to
the ``SignTool.exe`` file on your computer.
.. image:: img/UWP_sign_tool.png
After setting that up close the editor settings, go to Project > Export,
and select the UWP preset. Under the ``Signing`` options click on the folder
next to ``Certificate`` and go to the certificate file. Then enter the
pfxPassword in the password field.
.. image:: img/UWP_export_signing.png
Your project will now be automatically signed on export.
If you want to sign an exported app manually run ``SignTool.exe`` and use the
following command.
SignTool sign /fd SHA256 /a /f MyKey.pfx /p pfxPassword package.appx
Installing the package
----------------------
As of the Windows 10 Anniversary Update, you are able to install packages simply by
double clicking the ``.appx`` file from Windows Explorer.
It's also possible to install by using the ``Add-AppxPackage`` PowerShell cmdlet.
.. note:: If you want to update your already installed app, you must
update the version number on the new package or first uninstall
the previous package.

View File

@@ -0,0 +1,310 @@
.. _doc_exporting_for_web:
Exporting for the Web
=====================
HTML5 export allows publishing games made in Godot Engine to the browser.
This requires support for `WebAssembly
<https://webassembly.org/>`__ and `WebGL <https://www.khronos.org/webgl/>`__
in the user's browser.
.. important:: Use the browser-integrated developer console, usually opened
with :kbd:`F12`, to view **debug information** like JavaScript,
engine, and WebGL errors.
.. attention:: `There are significant bugs when running HTML5 projects on iOS
<https://github.com/godotengine/godot/issues?q=is:issue+is:open+label:platform:html5+ios>`__
(regardless of the browser). We recommend using
:ref:`iOS' native export functionality <doc_exporting_for_ios>`
instead, as it will also result in better performance.
WebGL version
-------------
Depending on your choice of renderer, Godot can target WebGL 1.0 (*GLES2*) or
WebGL 2.0 (*GLES3*).
WebGL 1.0 is the recommended option if you want your project to be supported
on all browsers with the best performance.
Godot's GLES3 renderer targets high end devices, and the performance using
WebGL 2.0 can be subpar. Some features are also not supported in WebGL 2.0
specifically.
Additionally, while most browsers support WebGL 2.0, this is not yet the case
for **Safari**. WebGL 2.0 support is coming in Safari 15 for macOS, and is not
available yet for any **iOS** browser (all WebKit-based like Safari).
See `Can I use WebGL 2.0 <https://caniuse.com/webgl2>`__ for details.
.. _doc_javascript_export_options:
Export options
--------------
If a runnable web export template is available, a button appears between the
*Stop scene* and *Play edited Scene* buttons in the editor to quickly open the
game in the default browser for testing.
You can choose the **Export Type** to select which features will be available:
- *Regular*: is the most compatible across browsers, will not support threads,
nor GDNative.
- *Threads*: will require the browser to support `SharedArrayBuffer
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer>`__.
See `Can I use SharedArrayBuffer <https://caniuse.com/sharedarraybuffer>`__
for details.
- *GDNative*: enables GDNative support but makes the binary bigger and slower
to load.
If you plan to use :ref:`VRAM compression <doc_import_images>` make sure that
**Vram Texture Compression** is enabled for the targeted platforms (enabling
both **For Desktop** and **For Mobile** will result in a bigger, but more
compatible export).
If a path to a **Custom HTML shell** file is given, it will be used instead of
the default HTML page. See :ref:`doc_customizing_html5_shell`.
**Head Include** is appended into the ``<head>`` element of the generated
HTML page. This allows to, for example, load webfonts and third-party
JavaScript APIs, include CSS, or run JavaScript code.
.. important:: Each project must generate their own HTML file. On export,
several text placeholders are replaced in the generated HTML
file specifically for the given export options. Any direct
modifications to that HTML file will be lost in future exports.
To customize the generated file, use the **Custom HTML shell**
option.
.. warning:: **Export types** other then *Regular* are not yet supported by the
C# version.
Limitations
-----------
For security and privacy reasons, many features that work effortlessly on
native platforms are more complicated on the web platform. Following is a list
of limitations you should be aware of when porting a Godot game to the web.
.. _doc_javascript_secure_contexts:
.. important:: Browser vendors are making more and more functionalities only
available in `secure contexts <https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts>`_,
this means that such features are only be available if the web
page is served via a secure HTTPS connection (localhost is
usually exempt from such requirement).
.. tip:: Check the `list of open HTML5 issues on GitHub
<https://github.com/godotengine/godot/issues?q=is:open+is:issue+label:platform:html5>`__
to see if the functionality you're interested in has an issue yet. If
not, open one to communicate your interest.
Using cookies for data persistence
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Users must **allow cookies** (specifically IndexedDB) if persistence of the
``user://`` file system is desired. When playing a game presented in an
``iframe``, **third-party** cookies must also be enabled. Incognito/private
browsing mode also prevents persistence.
The method ``OS.is_userfs_persistent()`` can be used to check if the
``user://`` file system is persistent, but can give false positives in some
cases.
Threads
~~~~~~~
As mentioned :ref:`above <doc_javascript_export_options>` multi-threading is
only available if the appropriate **Export Type** is set and support for it
across browsers is still limited.
.. warning:: Requires a :ref:`secure context <doc_javascript_secure_contexts>`.
Browsers are also starting to require that the web page is served with specific
`cross-origin isolation headers <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy>`__.
GDNative
~~~~~~~~
As mentioned :ref:`above <doc_javascript_export_options>` GDNative is only
available if the appropriate **Export Type** is set.
The export will also copy the required GDNative ``.wasm`` files to the output
folder (and must be uploaded to your server along with your game).
Full screen and mouse capture
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Browsers do not allow arbitrarily **entering full screen**. The same goes for
**capturing the cursor**. Instead, these actions have to occur as a response to
a JavaScript input event. In Godot, this means entering full screen from within
a pressed input event callback such as ``_input`` or ``_unhandled_input``.
Querying the :ref:`class_Input` singleton is not sufficient, the relevant
input event must currently be active.
For the same reason, the full screen project setting doesn't work unless the
engine is started from within a valid input event handler. This requires
:ref:`customization of the HTML page <doc_customizing_html5_shell>`.
Audio
~~~~~
Chrome restricts how websites may play audio. It may be necessary for the
player to click or tap or press a key to enable audio.
.. seealso:: Google offers additional information about their `Web Audio autoplay
policies <https://sites.google.com/a/chromium.org/dev/audio-video/autoplay>`__.
.. warning:: Access to microphone requires a
:ref:`secure context <doc_javascript_secure_contexts>`.
Networking
~~~~~~~~~~
Low level networking is not implemented due to lacking support in browsers.
Currently, only :ref:`HTTP client <doc_http_client_class>`,
:ref:`HTTP requests <doc_http_request_class>`,
:ref:`WebSocket (client) <doc_websocket>` and :ref:`WebRTC <doc_webrtc>` are
supported.
The HTTP classes also have several restrictions on the HTML5 platform:
- Accessing or changing the ``StreamPeer`` is not possible
- Threaded/Blocking mode is not available
- Cannot progress more than once per frame, so polling in a loop will freeze
- No chunked responses
- Host verification cannot be disabled
- Subject to `same-origin policy <https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy>`__
Clipboard
~~~~~~~~~
Clipboard synchronization between engine and the operating system requires a
browser supporting the `Clipboard API <https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API>`__,
additionally, due to the API asynchronous nature might not be reliable when
accessed from GDScript.
.. warning:: Requires a :ref:`secure context <doc_javascript_secure_contexts>`.
Gamepads
~~~~~~~~
Gamepads will not be detected until one of their button is pressed. Gamepads
might have the wrong mapping depending on the browser/OS/gamepad combination,
sadly the `Gamepad API <https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API>`__
does not provide a reliable way to detect the gamepad information necessary
to remap them based on model/vendor/OS due to privacy considerations.
.. warning:: Requires a :ref:`secure context <doc_javascript_secure_contexts>`.
Boot splash is not displayed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The default HTML page does not display the boot splash while loading. However,
the image is exported as a PNG file, so :ref:`custom HTML pages <doc_customizing_html5_shell>`
can display it.
Shader language limitations
~~~~~~~~~~~~~~~~~~~~~~~~~~~
When exporting a GLES2 project to HTML5, WebGL 1.0 will be used. WebGL 1.0
doesn't support dynamic loops, so shaders using those won't work there.
Serving the files
-----------------
Exporting for the web generates several files to be served from a web server,
including a default HTML page for presentation. A custom HTML file can be
used, see :ref:`doc_customizing_html5_shell`.
The generated ``.html`` file can be used as ``DirectoryIndex`` in Apache
servers and can be renamed to e.g. ``index.html`` at any time, its name is
never depended on by default.
The HTML page draws the game at maximum size within the browser window.
This way it can be inserted into an ``<iframe>`` with the game's size, as is
common on most web game hosting sites.
The other exported files are served as they are, next to the ``.html`` file,
names unchanged. The ``.wasm`` file is a binary WebAssembly module implementing
the engine. The ``.pck`` file is the Godot main pack containing your game. The
``.js`` file contains start-up code and is used by the ``.html`` file to access
the engine. The ``.png`` file contains the boot splash image. It is not used in
the default HTML page, but is included for
:ref:`custom HTML pages <doc_customizing_html5_shell>`.
The ``.pck`` file is binary, usually delivered with the MIME-type
:mimetype:`application/octet-stream`. The ``.wasm`` file is delivered as
:mimetype:`application/wasm`.
.. caution:: Delivering the WebAssembly module (``.wasm``) with a MIME-type
other than :mimetype:`application/wasm` can prevent some start-up
optimizations.
Delivering the files with server-side compression is recommended especially for
the ``.pck`` and ``.wasm`` files, which are usually large in size.
The WebAssembly module compresses particularly well, down to around a quarter
of its original size with gzip compression.
**Hosts that provide on-the-fly compression:** GitHub Pages (gzip)
**Hosts that don't provide on-the-fly compression:** itch.io, GitLab Pages
(`supports manual gzip precompression <https://webd97.de/post/gitlab-pages-compression/>`__)
.. _doc_javascript_eval:
Calling JavaScript from script
------------------------------
In web builds, the ``JavaScript`` singleton is implemented. It offers a single
method called ``eval`` that works similarly to the JavaScript function of the
same name. It takes a string as an argument and executes it as JavaScript code.
This allows interacting with the browser in ways not possible with script
languages integrated into Godot.
::
func my_func():
JavaScript.eval("alert('Calling JavaScript per GDScript!');")
The value of the last JavaScript statement is converted to a GDScript value and
returned by ``eval()`` under certain circumstances:
* JavaScript ``number`` is returned as GDScript :ref:`class_float`
* JavaScript ``boolean`` is returned as GDScript :ref:`class_bool`
* JavaScript ``string`` is returned as GDScript :ref:`class_String`
* JavaScript ``ArrayBuffer``, ``TypedArray`` and ``DataView`` are returned as
GDScript :ref:`class_PoolByteArray`
::
func my_func2():
var js_return = JavaScript.eval("var myNumber = 1; myNumber + 2;")
print(js_return) # prints '3.0'
Any other JavaScript value is returned as ``null``.
HTML5 export templates may be :ref:`built <doc_compiling_for_web>` without
support for the singleton to improve security. With such templates, and on
platforms other than HTML5, calling ``JavaScript.eval`` will also return
``null``. The availability of the singleton can be checked with the
``JavaScript`` :ref:`feature tag <doc_feature_tags>`::
func my_func3():
if OS.has_feature('JavaScript'):
JavaScript.eval("""
console.log('The JavaScript singleton is available')
""")
else:
print("The JavaScript singleton is NOT available")
.. tip:: GDScript's multi-line strings, surrounded by 3 quotes ``"""`` as in
``my_func3()`` above, are useful to keep JavaScript code readable.
The ``eval`` method also accepts a second, optional Boolean argument, which
specifies whether to execute the code in the global execution context,
defaulting to ``false`` to prevent polluting the global namespace::
func my_func4():
# execute in global execution context,
# thus adding a new JavaScript global variable `SomeGlobal`
JavaScript.eval("var SomeGlobal = {};", true)

View File

@@ -0,0 +1,144 @@
.. _doc_exporting_pcks:
Exporting packs, patches, and mods
==================================
Use cases
---------
Oftentimes one would like to add functionality to one's game after it has been
deployed.
Examples of this include...
- Downloadable Content: the ability to add features and content to one's game.
- Patches: the ability to fix a bug that is present in a shipped product.
- Mods: grant other people the ability to create content for one's game.
These tools help developers to extend their development beyond the initial
release.
Overview of PCK files
---------------------
Godot enables this via a feature called **resource packs** (PCK files,
with extension ``.pck``).
**Advantages:**
- incremental updates/patches
- offer DLCs
- offer mod support
- no source code disclosure needed for mods
- more modular project structure
- users don't have to replace the entire game
The first part of using them involves exporting and delivering the project to
players. Then, when one wants to add functionality or content later on, they
just deliver the updates via PCK files to the users.
PCK files usually contain, but are not limited to:
- scripts
- scenes
- shaders
- models
- textures
- sound effects
- music
- any other asset suitable for import into the game
The PCK files can even be an entirely different Godot project, which the
original game loads in at runtime.
Generating PCK files
--------------------
In order to pack all resources of a project into a PCK file open the project
and go to Project/Export and click on “Export PCK/Zip”. Also make sure to have
an export template selected while doing so.
.. image:: img/export_pck.png
Another method would be to :ref:`export from the command line <doc_command_line_tutorial_exporting>`.
If the output file ends with a PCK or ZIP file extension, then the export
process will build that type of file for the chosen platform.
.. note::
If one wishes to support mods for their game, they will need their users to
create similarly exported files. Assuming the original game expects a
certain structure for the PCK's resources and/or a certain interface for
its scripts, then either...
1. The developer must publicize documentation of these expected structures/
interfaces, expect modders to install Godot Engine, and then also expect
those modders to conform to the documentation's defined API when building
mod content for the game (so that it will work). Users would then use
Godot's built in exporting tools to create a PCK file, as detailed
above.
2. The developer uses Godot to build a GUI tool for adding their exact API
content to a project. This Godot tool must either run on a tools-enabled
build of the engine or have access to one (distributed alongside or
perhaps in the original game's files). The tool can then use the Godot
executable to export a PCK file from the command line with
:ref:`OS.execute() <class_OS_method_execute>`. It makes the most sense for the
game to not use a tool-build though (for security) and for the modding
tools to *do* use a tool-enabled engine build.
Opening PCK files at runtime
----------------------------
To import a PCK file, one uses the ProjectSettings singleton. The following
example expects a “mod.pck” file in the directory of the games executable.
The PCK file contains a “mod_scene.tscn” test scene in its root.
.. tabs::
.. code-tab:: gdscript GDScript
func _your_function():
# This could fail if, for example, mod.pck cannot be found.
var success = ProjectSettings.load_resource_pack("res://mod.pck")
if success:
# Now one can use the assets as if they had them in the project from the start.
var imported_scene = load("res://mod_scene.tscn")
.. code-tab:: csharp
private void YourFunction()
{
// This could fail if, for example, mod.pck cannot be found.
var success = ProjectSettings.LoadResourcePack("res://mod.pck");
if (success)
{
// Now one can use the assets as if they had them in the project from the start.
var importedScene = (PackedScene)ResourceLoader.Load("res://mod_scene.tscn");
}
}
.. warning::
By default, if you import a file with the same file path/name as one you already have in your
project, the imported one will replace it. This is something to watch out for when
creating DLC or mods (solved easily with a tool isolating mods to a specific mods
subfolder). However, it is also a way of creating patches for one's own game. A
PCK file of this kind can fix the content of a previously loaded PCK.
To opt out of this behavior, pass ``false`` as the second argument to
:ref:`ProjectSettings.load_resource_pack() <class_ProjectSettings_method_load_resource_pack>`.
.. note::
For a C# project, you need to build the DLL and place it in the project directory first.
Then, before loading the resource pack, you need to load its DLL as follows:
``Assembly.LoadFile("mod.dll")``
Summary
-------
This tutorial should illustrate how easy adding mods, patches or DLC to a game
is. The most important thing is to identify how one plans to distribute future
content for their game and develop a workflow that is customized for that
purpose. Godot should make that process smooth regardless of which route a
developer pursues.

View File

@@ -0,0 +1,190 @@
.. _doc_exporting_projects:
Exporting projects
==================
.. highlight:: none
Why export?
-----------
Originally, Godot did not have any means to export projects. The
developers would compile the proper binaries and build the packages for
each platform manually.
When more developers (and even non-programmers) started using it, and
when our company started taking more projects at the same time, it
became evident that this was a bottleneck.
On PC
~~~~~
Distributing a game project on PC with Godot is rather easy. Drop
the Godot binary in the same directory as the ``project.godot`` file,
then compress the project directory and you are done.
It sounds simple, but there are probably a few reasons why the developer
may not want to do this. The first one is that it may not be desirable
to distribute loads of files. Some developers may not like curious users
peeking at how the game was made, others may find it inelegant, and so on.
Another reason is that the developer might prefer a specially-compiled
binary, which is smaller in size, more optimized and does not include
tools like the editor and debugger.
Finally, Godot has a simple but efficient system for
:ref:`creating DLCs as extra package files <doc_exporting_pcks>`.
On mobile
~~~~~~~~~
The same scenario on mobile platforms is a little worse.
To distribute a project on those devices, a binary for each of
those platforms is built, then added to a native project together
with the game data.
This can be troublesome because it means that the developer must be
familiarized with the SDK of each platform before even being able to
export. While learning each SDK is always encouraged, it can be
frustrating to be forced to do it at an undesired time.
There is also another problem with this approach: different devices
prefer some data in different formats to run. The main example of this
is texture compression. All PC hardware uses S3TC (BC) compression and
that has been standardized for more than a decade, but mobile devices
use different formats for texture compression, such as PVRTC (iOS) or
ETC (Android).
Export menu
-----------
After many attempts at different export workflows, the current one has
proven to work the best. At the time of this writing, not all platforms are
supported yet, but the supported platforms continue to grow.
To open the export menu, click the **Export** button:
.. image:: img/export.png
The export menu will open. However, it will be completely empty.
This is because we need to add an export preset.
.. image:: img/export_dialog.png
To create an export preset, click the **Add…** button at the top
of the export menu. This will open a drop-down list of platforms
to choose from for an export preset.
.. image:: img/export_preset.png
The default options are often enough to export, so tweaking them is
usually not necessary. However, many platforms require additional
tools (SDKs) to be installed to be able to export. Additionally, Godot
needs export templates installed to create packages. The export menu
will complain when something is missing and will not allow the user to
export for that platform until they resolve it:
.. image:: img/export_error.png
At that time, the user is expected to come back to the documentation and follow
instructions on how to properly set up that platform.
Export templates
~~~~~~~~~~~~~~~~
Apart from setting up the platform, the export templates must be
installed to be able to export projects. They can be obtained as a
TPZ file (which is a renamed ZIP archive) from the
`download page of the website <https://www.godotengine.org/download>`_.
Once downloaded, they can be installed using the **Install Export Templates**
option in the editor:
.. image:: img/exptemp.png
.. _doc_exporting_projects_export_mode:
Export mode
~~~~~~~~~~~
When exporting, Godot makes a list of all the files to export and then
creates the package. There are 3 different modes for exporting:
- Export all resources in the project
- Export selected scenes (and dependencies)
- Export selected resources (and dependencies)
.. image:: img/expres.png
**Export all resources in the project** will export every resource in the
project. **Export selected scenes** and **Export selected resources** gives
you a list of the scenes or resources in the project, and you have to
select every scene or resource you want to export.
.. image:: img/expselected.png
Exporting from the command line
-------------------------------
In production, it is useful to automate builds, and Godot supports this
with the ``--export`` and ``--export-debug`` command line parameters.
Exporting from the command line still requires an export preset to define
the export parameters. A basic invocation of the command would be:
.. code-block:: shell
godot --export "Windows Desktop" some_name
This will export to ``some_name.exe``, assuming there is a preset
called "Windows Desktop" and the template can be found.
The output path is relative to the project path or absolute;
it does not respect the directory the command was invoked from.
You can also configure it to export only the PCK or ZIP file, allowing
a single export to be used with multiple Godot executables.
This takes place if the target name ends with ``.pck`` or ``.zip``.
It is often useful to combine the ``--export`` flag with the ``--path``
flag, and to create a dedicated export preset for automated export:
.. code-block:: shell
godot --path path/to/project --export "pck" game_name.pck
PCK versus ZIP pack file formats
--------------------------------
Each format has its upsides and downsides. PCK is the default and recommended
format for most use cases, but you may want to use a ZIP archive instead
depending on your needs.
**PCK format:**
- Uncompressed format. Larger file size, but faster to read/write.
- Not readable and writable using tools normally present on the user's
operating system, even though there are
`third-party tools <https://github.com/hhyyrylainen/GodotPckTool>`__
to extract and create PCK files.
**ZIP format:**
- Compressed format. Smaller file size, but slower to read/write.
- Readable and writable using tools normally present on the user's operating system.
This can be useful to make modding easier (see also :ref:`doc_exporting_pcks`).
.. warning::
Due to a `known bug <https://github.com/godotengine/godot/pull/42123>`__,
when using a ZIP file as a pack file, the exported binary will not try to use
it automatically. Therefore, you have to create a *launcher script* that
the player can double-click or run from a terminal to launch the project::
:: launch.bat (Windows)
@echo off
my_project.exe --main-pack my_project.zip
# launch.sh (Linux)
./my_project.x86_64 --main-pack my_project.zip
Save the launcher script and place it in the same folder as the exported binary.
On Linux, make sure to give executable permissions to the launcher script using
the command ``chmod +x launch.sh``.

View File

@@ -0,0 +1,133 @@
.. _doc_feature_tags:
Feature tags
============
Introduction
------------
Godot has a special system to tag availability of features.
Each *feature* is represented as a string, which can refer to many of the following:
* Platform name.
* Platform architecture (64-bit or 32-bit, x86 or ARM).
* Platform type (desktop, mobile, Web).
* Supported texture compression algorithms on the platform.
* Whether a build is ``debug`` or ``release`` (``debug`` includes the editor).
* Whether the project is running from the editor or a "standalone" binary.
* Many more things.
Features can be queried at run-time from the singleton API by calling:
::
OS.has_feature(name)
Default features
----------------
Here is a list of most feature tags in Godot. Keep in mind they are **case-sensitive**:
+-----------------+--------------------------------------------------------+
| **Feature tag** | **Description** |
+=================+========================================================+
| **Android** | Running on Android |
+-----------------+--------------------------------------------------------+
| **HTML5** | Running on HTML5 |
+-----------------+--------------------------------------------------------+
| **JavaScript** | :ref:`JavaScript singleton <doc_javascript_eval>` is |
| | available |
+-----------------+--------------------------------------------------------+
| **OSX** | Running on macOS |
+-----------------+--------------------------------------------------------+
| **iOS** | Running on iOS |
+-----------------+--------------------------------------------------------+
| **UWP** | Running on UWP |
+-----------------+--------------------------------------------------------+
| **Windows** | Running on Windows |
+-----------------+--------------------------------------------------------+
| **X11** | Running on X11 (Linux/BSD desktop) |
+-----------------+--------------------------------------------------------+
| **Server** | Running on the headless server platform |
+-----------------+--------------------------------------------------------+
| **debug** | Running on a debug build (including the editor) |
+-----------------+--------------------------------------------------------+
| **release** | Running on a release build |
+-----------------+--------------------------------------------------------+
| **editor** | Running on an editor build |
+-----------------+--------------------------------------------------------+
| **standalone** | Running on a non-editor build |
+-----------------+--------------------------------------------------------+
| **64** | Running on a 64-bit build (any architecture) |
+-----------------+--------------------------------------------------------+
| **32** | Running on a 32-bit build (any architecture) |
+-----------------+--------------------------------------------------------+
| **x86_64** | Running on a 64-bit x86 build |
+-----------------+--------------------------------------------------------+
| **x86** | Running on a 32-bit x86 build |
+-----------------+--------------------------------------------------------+
| **arm64** | Running on a 64-bit ARM build |
+-----------------+--------------------------------------------------------+
| **arm** | Running on a 32-bit ARM build |
+-----------------+--------------------------------------------------------+
| **mobile** | Host OS is a mobile platform |
+-----------------+--------------------------------------------------------+
| **pc** | Host OS is a PC platform (desktop/laptop) |
+-----------------+--------------------------------------------------------+
| **web** | Host OS is a Web browser |
+-----------------+--------------------------------------------------------+
| **etc** | Textures using ETC1 compression are supported |
+-----------------+--------------------------------------------------------+
| **etc2** | Textures using ETC2 compression are supported |
+-----------------+--------------------------------------------------------+
| **s3tc** | Textures using S3TC (DXT/BC) compression are supported |
+-----------------+--------------------------------------------------------+
| **pvrtc** | Textures using PVRTC compression are supported |
+-----------------+--------------------------------------------------------+
Custom features
---------------
It is possible to add custom features to a build; use the relevant
field in the *export preset* used to generate it:
.. image:: img/feature_tags1.png
Overriding project settings
---------------------------
Features can be used to override specific configuration values in the *Project Settings*.
This allows you to better customize any configuration when doing a build.
In the following example, a different icon is added for the demo build of the game (which was
customized in a special export preset, which, in turn, includes only demo levels).
.. image:: img/feature_tags2.png
After overriding, a new field is added for this specific configuration:
.. image:: img/feature_tags3.png
.. note::
When using the
:ref:`project settings "override.cfg" functionality <class_ProjectSettings>`
(which is unrelated to feature tags), remember that feature tags still apply.
Therefore, make sure to *also* override the setting with the desired feature
tag(s) if you want them to override base project settings on all platforms
and configurations.
Default overrides
-----------------
There are already a lot of settings that come with overrides by default; they can be found
in many sections of the project settings.
.. image:: img/feature_tags4.png
Customizing the build
---------------------
Feature tags can be used to customize a build process too, by writing a custom **ExportPlugin**.
They are also used to specify which shared library is loaded and exported in **GDNative**.

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

View File

@@ -0,0 +1,20 @@
Export
======
.. toctree::
:maxdepth: 1
:name: toc-learn-workflow-export
exporting_projects
exporting_pcks
feature_tags
exporting_for_pc
changing_application_icon_for_windows
exporting_for_uwp
exporting_for_ios
exporting_for_android
android_custom_build
exporting_for_web
exporting_for_dedicated_servers
one-click_deploy

View File

@@ -0,0 +1,60 @@
.. _doc_one-click_deploy:
One-click deploy
================
What is one-click deploy?
-------------------------
One-click deploy is a feature that is available once a platform is properly
configured and a supported device is connected to the computer. Since things can
go wrong at many levels (platform may not be configured correctly, SDK may be
incorrectly installed, device may be improperly configured, etc.), it's good to
let the user know that it exists.
After adding an Android export preset marked as Runnable, Godot can detect when
a USB device is connected to the computer and offer the user to automatically
export, install and run the project (in debug mode) on the device. This feature
is called *one-click deploy*.
.. note::
One-click deploy is only available once you've added an export template
marked as **Runnable** in the Export dialog. You can mark several export
presets as runnable, but only one preset per platform may be marked as
runnable. If you mark a second preset in a given platform as runnable, the
other preset will no longer be marked as runnable.
Supported platforms
-------------------
- **Android:** Exports the project with debugging enabled and runs it on the
connected device.
- Make sure to follow the steps described in :ref:`doc_exporting_for_android`.
Otherwise, the one-click deploy button won't appear.
- If you have more than one device connected, Godot will ask you which device
the project should be exported to.
- **HTML5:** Starts a local web server and runs the exported project by opening
the default web browser.
Support for more platforms such as iOS is planned.
Using one-click deploy
----------------------
- If deploying to Android, enable developer mode on your mobile device
then enable USB debugging in the device's settings.
- After enabling USB debugging, connect the device to your PC using an USB cable.
- For advanced users, it should also be possible to use wireless ADB.
- Make sure there is an export preset marked as **Runnable** for the target
platform (Android or HTML5).
- If everything is configured correctly and with no errors, platform-specific
icons will appear in the top-right corner of the editor.
- Click the button to export to the desired platform in one click.
.. image:: img/oneclick.png