Jump to content

Positioning Loading Screen


freetoplay
 Share

Recommended Posts

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?

Link to comment
Share on other sites

  • 1 month later...

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>

 

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