I already tried several browsers!
a function:
window.addEventListener (‘resize’, function () {
engine.resize ();
});
it’s working! But the GUI is not a screen that can be used on the screen, but resizing the screen is not combined.
here is my index.html>
<! DOCTYPE html>
#renderCanvas {
width: 100%;
height: 100%;
touch action: none;
}
</ style>
</ head>
</ canvas>
</ body>
</ html>
this is the code>
window.addEventListener (‘DOMContentLoaded’, function () {
var canvas, motor, scene, camera, light;
var floor_1, floor_2, wall_1;
canvas = document.getElementById (‘renderCanvas’);
engine = new BABYLON.Engine (screen, true);
// scene creation function that creates and returns the scene
var createScene = function () {
scene = new BABYLON.Cena (engine);
scene.collisionsEnabled = true;
camera = new BABYLON.ArcRotateCamera (“camera1”, Math.PI / 2, Math.PI / 4, 3, new BABYLON.Vector3 (0, 0,6, 0), scene);
camera.attachControl (screen, true);
camera.lowerRadiusLimit = 2;
camera.upperRadiusLimit = 82;
camera.wheelDeltaPercentage = 0.006;
// (x: 0, y: 5, z: -10)
light = new BABYLON.HemisphericLight (“light1”, new BABYLON.Vector3 (0, 4, 0), scene);
light.intensity = 1;
light.specular = BABYLON.Color3.Black ();
// cfg_start_end
// cfg_path
return scene;
};
// and_scene
var scene = createScene ();
// execute the render loop
engine.runRenderLoop (function () {
scene.render ();
});
// the screen / window resizing event handler
window.addEventListener (‘resize’, function () {
engine.resize ();
});
});
I honestly should not have the code like that, but … the playerground;
works differently from an index.html page in js linked files.
Can someone help me with this, please? How do I get a GUI to work with rezise!
The code is complete is not complete! And as parts that I found important to show …