mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
[HTML5] Implement fullscreenchange in JS library.
Removes more emscripten HTML5 library dependencies.
This commit is contained in:
parent
b7ac3c1aeb
commit
ac78e7f940
4 changed files with 25 additions and 19 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue