Jump to content

babylonjs playground as <div id="canvasZone"> causing problem


Valmor
 Share

Recommended Posts

Hi

the div in code generated from babylon playground, in .zip mode like this:
 <div id="canvasZone">
        <canvas id="renderCanvas"></canvas>
    </div>

I need change code, removing this because resizing or mobile device cause a problem no resizing canvas
<canvas id="renderCanvas"></canvas>

Is this a correct thing or did I do somenthin wrong?


 
Link to comment
Share on other sites

Hi @Deltakosh
 

Thanks for the quick response.
Yes, I understand, is that in the example / code generated there is in the <style> is not in 100%, alias, there is no reference to canvasZone style.
For beginners like me this can  be hard to detect when it comes to learning.


Congratulations for this great project 

image: my first tests
 

teste.png

Link to comment
Share on other sites

The code generated in playground:
(..)
<style>
            html, body {
                overflow: hidden;
                width: 100%;
                height: 100%;
                margin: 0;
                padding: 0;
            }

            #renderCanvas {
                width: 100%;
                height: 100%;
                touch-action: none;
            }
        </style>
    </head>
<body>
    <div id="canvasZone">
        <canvas id="renderCanvas"></canvas>
    </div>

(...)

Link to comment
Share on other sites

No problem.
As a initiator in BJS it look me a while to know that I was not adjusting the window because of the div.
As a playground is to facilitate a learning, so I suggested  this improvement. But, of course, it is not an impediment, just a suggestion.

Thanks 

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