Jump to content

Rendercanvas change size when first focused


Hillardo
 Share

Recommended Posts

Hello,

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?

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

 

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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