How do I switch to FullScreen in HTML5 Export...???

Zappo_IIZappo_II Posts: 4Member

Hi...

...in my game I do something like:

if Input.is_action_just_released("ui_toggleFullscreen"):
    OS.window_fullscreen = !OS.window_fullscreen
    get_node("NEDB-PD-SUBCaptions").add_infoMessage("Toggle FullScreen " + ("on" if OS.window_fullscreen else "off"))

...which works perfectly well in Linux and Windows exports but does nothing in HTML5...

The DOCs states https://docs.godotengine.org/en/3.0/getting_started/workflow/export/exporting_for_web.html#full-screen-and-mouse-capture some hints, but I lack the ability to imagine what to do...

Could someone provide some guidance please...???

Do I have to implement this independently of my game in a purely HTML5/JavaScript wrapping thingy or do I have to use the JavaScript Singleton in case OS.get_name == "HTML5" to inject some user Click Events to the Browser or didn't I get the idea in general...???

Please advise...

THX & cheers...


Tags :

Best Answer

  • Zappo_IIZappo_II Posts: 4
    Accepted Answer

    Ok, some othe guy some where else on the internet pointed me to implement it like this:
    func _input(ev): if ev.is_action_pressed('ui_toggleFullscreen'): OS.window_fullscreen = !OS.window_fullscreen
    Works as expected now...

Answers

  • Zappo_IIZappo_II Posts: 4Member
    Accepted Answer

    Ok, some othe guy some where else on the internet pointed me to implement it like this:
    func _input(ev): if ev.is_action_pressed('ui_toggleFullscreen'): OS.window_fullscreen = !OS.window_fullscreen
    Works as expected now...

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file