Jump to content

Rendercanvas change size when first focused


Recommended Posts


I just started to work with Babylonjs. I want to include my scene inside a HTML page and use HTML elements for the input. But every time I focus the render canvas, the other HTML parts disappear, and the render canvas fill the entire screen. Is it possible to prevent this or should I use the GUI from Babylonjs for the input?

html, body {
overflow: hidden;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
#renderCanvas {
width: 100%;
height: 100%;
touch-action: none;
<div id="input">
Eingabe:<input type="text" id="Uinput" > //Text input
Schriftgröße:<input type="number" id="Sizeinput" value="48" >//Fontsize input
<canvas id="renderCanvas"></canvas>


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...