Exemplo n.º 1
0
        protected override void LoadContent()
        {
            m_spriteBatch = new CustomSpriteBatch(new SpriteBatch(GraphicsDevice), GraphicsDevice);

            Mrag.Initialize(this, m_graphics, m_spriteBatch, GraphicsDevice);

            base.LoadContent();
        }
Exemplo n.º 2
0
        protected override void Update(GameTime gameTime)
        {
            Mrag.Update();

            if (Input.KeyPressed(Keys.Escape))
            {
                Exit();
            }

            base.Update(gameTime);
        }
Exemplo n.º 3
0
        protected override void Draw(GameTime gameTime)
        {
            m_spriteBatch.Begin();
            GraphicsDevice.Clear(Color.Black);

            double fps = Math.Round(1000.0 / gameTime.ElapsedGameTime.TotalMilliseconds);

            m_spriteBatch.DrawString($"FPS: {fps}", Vector2.Zero);

            GUI.Begin();
            if (GUI.Button("Click me!", 50, 50))
            {
                Console.WriteLine("Button was clicked :O");
            }
            GUI.End();

            Mrag.Render();
            m_spriteBatch.End();

            base.Draw(gameTime);
        }