diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-01-30 11:35:03 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-02-19 05:12:32 +0100 |
commit | 65abf94675fbd7fddf8b3350efd15507ed3fb76a (patch) | |
tree | 1a7e0f39b69bc071fb6da2c048440549e06e5348 /platform/javascript/export | |
parent | 2972ea32297adfd9cc08c81dd85339679365f52e (diff) |
[HTML5] Better fullscreen, canvas resizing.
Three canvas resize policies:
- `None`: Godot window settings are ignored.
- `Project`: Godot handles the canvas like a native app (resizing it
when setting the window size).
- `Adaptive`: Canvas size will always adapt to browser window size.
Use `None` if you want to control the canvas size with custom JavaScript
code.
Diffstat (limited to 'platform/javascript/export')
-rw-r--r-- | platform/javascript/export/export.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index fa8b000259..353cc49ef8 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -296,7 +296,7 @@ void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t> &p_html, const Re args.push_back(flags[i]); } Dictionary config; - config["canvasResizePolicy"] = p_preset->get("html/full_window_size") ? 2 : 1; + config["canvasResizePolicy"] = p_preset->get("html/canvas_resize_policy"); config["gdnativeLibs"] = libs; config["executable"] = p_name; config["args"] = args; @@ -350,7 +350,7 @@ void EditorExportPlatformJavaScript::get_export_options(List<ExportOption> *r_op r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/custom_html_shell", PROPERTY_HINT_FILE, "*.html"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/head_include", PROPERTY_HINT_MULTILINE_TEXT), "")); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "html/full_window_size"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "html/canvas_resize_policy", PROPERTY_HINT_ENUM, "None,Project,Adaptive"), 2)); } String EditorExportPlatformJavaScript::get_name() const { |