Пример #1
0
        protected override void LoadContent()
        {
            // GraphicsDevice is not available until now
            var windowInterface = new WindowInterface(this.specification.settings.startingWindowSize, Window, MachinaClient.Graphics, GraphicsDevice);

            Runtime = new MachinaRuntime(this, this.specification, platformContext, new Painter(GraphicsDevice));
            Runtime.LateSetup(this.gameCartridge, windowInterface);
        }
Пример #2
0
 protected void BuildSceneLayers(MachinaRuntime runtime)
 {
     if (SceneLayers == null)
     {
         // this is lazy initialized for the dumbest reason: to be debuggable it needs to have a font, the font doesn't come in until after loading is complete
         SceneLayers = new SceneLayers(new GameViewport(renderResolution, resizeBehavior), runtime);
         if (!this.skipDebug)
         {
             SceneLayers.BuildDebugScene(this);
         }
     }
 }
Пример #3
0
        public void Setup(MachinaRuntime runtime, GameSpecification specification)
        {
            if (!this.hasBeenSetup)
            {
                BuildSceneLayers(runtime);
                CurrentGameCanvas.BuildCanvas(runtime.Painter);

                runtime.platformContext.OnCartridgeSetup(this, runtime.WindowInterface);
                runtime.WindowInterface.Resized += (size) => CurrentGameCanvas.SetWindowSize(size);

                OnGameLoad(specification, runtime);

                this.hasBeenSetup = true;
            }
        }
Пример #4
0
 /// <summary>
 /// This is executed right after the loading screen finishes. This is your "Main" function.
 /// </summary>
 /// <param name="specification"></param>
 /// <param name="runtime"></param>
 public abstract void OnGameLoad(GameSpecification specification, MachinaRuntime runtime);