Skip to content

Fullscreen on HTML-based UI #2323

Answered by eonarheim
ttay24 asked this question in Q&A
May 24, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi @ttay24 great question!

You'll need to work around the way excalibur is implemented at the moment (I'll add an issue to support this out of the box). Excalibur currently targets the canvas element directly.

As a workaround, you can define a container element around a game canvas, and position your UI elements above the canvas. Then manually invoke the fullscreen browser api on that container element, which will include those UI elements.

The browser only allows the fullscreen api to be triggered by a user action so you may need to wire up to an html button or reuse the excalibur start button.

.ui {
  position: absolute;
  right: 0;
}
<div id="container" class="container">
    <div class="

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ttay24
Comment options

@eonarheim
Comment options

Answer selected by ttay24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants