1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

[HTML5] Implement fullscreenchange in JS library.

Removes more emscripten HTML5 library dependencies.
This commit is contained in:
Fabio Alessandrelli
2021-09-12 12:19:33 +02:00
parent b2d30c725d
commit b6315afc9a
4 changed files with 22 additions and 18 deletions

View File

@@ -853,6 +853,20 @@ const GodotDisplay = {
/*
* Listeners
*/
godot_js_display_fullscreen_cb__sig: 'vi',
godot_js_display_fullscreen_cb: function (callback) {
const canvas = GodotConfig.canvas;
const func = GodotRuntime.get_func(callback);
function change_cb(evt) {
if (evt.target === canvas) {
func(GodotDisplayScreen.isFullscreen());
}
}
GodotDisplayListeners.add(document, 'fullscreenchange', change_cb, false);
GodotDisplayListeners.add(document, 'mozfullscreenchange', change_cb, false);
GodotDisplayListeners.add(document, 'webkitfullscreenchange', change_cb, false);
},
godot_js_display_notification_cb__sig: 'viiiii',
godot_js_display_notification_cb: function (callback, p_enter, p_exit, p_in, p_out) {
const canvas = GodotConfig.canvas;