freetoplay Posted September 3, 2018 Share Posted September 3, 2018 Is there a way to change the position of the loading screen to static? Right now, when the loading screen appears after the page load, it is positioned outside of the layout, probably due to it being fixed/absolute position, instead of staying within the container. Is there a way to override the positioning in this case? Quote Link to comment Share on other sites More sharing options...
Guest Posted September 4, 2018 Share Posted September 4, 2018 You can even provide your own https://doc.babylonjs.com/how_to/creating_a_custom_loading_screen You can also keep the current one and override its css style (id is "babylonjsLoadingDiv") freetoplay 1 Quote Link to comment Share on other sites More sharing options...
freetoplay Posted October 26, 2018 Author Share Posted October 26, 2018 Hmm, so after playing around with this for awhile, I have not been able to set the positioning of the loading screen or disable it. I have been unable to get the id of the CSS, possibly because I am loading the scenes within a Vue component, what should I do in this case? My code looks something like this to create the scene canvas: <template> <canvas ref="canvas" class="canvas" :style="{height: height, width: width, outline: none, display: 'block'}"></canvas> </template> <script lang="ts"> export interface ISceneArgs { engine: BABYLON.Engine; scene: BABYLON.Scene; canvas: HTMLCanvasElement; } export default { name: "SceneComponent", data: function() { return { engine: null, scene: null }; }, props: { onSceneMount: { type: Function, required: true }, height: { type: String, default: "100%" }, width: { type: String, default: "100%" } }, mounted() { this.setupScene(); }, methods: { setupScene() { const canvas = this.$refs.canvas as HTMLCanvasElement; this.engine = new BABYLON.Engine( canvas, true, { preserveDrawingBuffer: true }, false ); const scene = new BABYLON.Scene(this.engine); this.scene = scene; this.onSceneMount({ scene: this.scene, engine: this.engine, canvas: this.$refs.canvas }); } }, beforeDestroy() { window.removeEventListener("resize", this.handleResize); } }; </script> Quote Link to comment Share on other sites More sharing options...
Guest Posted October 26, 2018 Share Posted October 26, 2018 Can you share a LIVE example? something than I can try directly (I'm in a rush so I do not have a lot of time to setup a server and test it) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.