示例#1
0
        public GamePage()
        {
            this.InitializeComponent();

            // Create the game.
            var launchArguments = string.Empty;

            _game = MonoGame.Framework.XamlGame <MonoGearGame> .Create(launchArguments, Window.Current.CoreWindow, swapChainPanel);
        }
示例#2
0
        public MonoGearGame()
        {
            // Required for static entity/level related methods
            instance = this;

            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Event that triggers when the client size is changed
            Window.ClientSizeChanged += (s, e) =>
            {
                if (activeCamera != null)
                {
                    // Update viewport size
                    activeCamera.UpdateViewport(graphics.GraphicsDevice.Viewport);
                }
            };
        }