public override void Draw(SpriteBatch _spriteBatch)
        {
            _graphicsDevice.Clear(m_color);
            _spriteBatch.Begin(transformMatrix: scaleMatrix);
            // Draw sprites here



            int touchpointdata = 0;

            foreach (TouchLocation tl in touchcollection)
            {
                //Matrix PointWorldLocation =  Matrix.CreateScale(tl.Position.X / 800, tl.Position.Y / 480, 1.0f);



                _spriteBatch.DrawString(font, "Tapping point:" + tl.Position.ToString(), new Vector2(0, 0 + touchpointdata * 20), Color.White);
                touchpointdata++;
            }

            _spriteBatch.DrawString(font, "Joystick Left:" + JoystickLeft.GetJoystickDirection().ToString(), new Vector2(0, 60), Color.White);
            _spriteBatch.DrawString(font, "Joystick Right:" + JoystickRight.GetJoystickDirection().ToString(), new Vector2(0, 80), Color.White);

            _spriteBatch.DrawString(font, "Tapping point:", new Vector2(0, 0), Color.White);
            JoystickLeft.Draw(_spriteBatch);
            JoystickRight.Draw(_spriteBatch);

            _spriteBatch.End();
        }
Exemplo n.º 2
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            _graphicsDevice.Clear(new Color(01, 14, 35));



            spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearWrap, null, transformMatrix: Game1.m_scaleMatrix);
            foreach (ParallaxBackground background in m_parallaxBackgrounds)
            {
                background.Draw(spriteBatch);
            }
            spriteBatch.End();



            spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, m_camera.Transform);

            m_border.Draw(spriteBatch);

            spriteBatch.End();



            quadtree.Childrenof(quadtree, QuadList);


            /*
             *  foreach (QuadTree kid in QuadList)
             *  {
             *      if (kid != null)
             *      {
             *          kid.Draw(spriteBatch, m_camera.Transform);
             *      }
             *  }
             */

            #region DebugInfo

            spriteBatch.Begin();

            /* spriteBatch.DrawString(font, "Bullet dir normalised:" + m_player.m_bulletdirection.ToString(), new Vector2(0, 40), Color.White);
             * spriteBatch.DrawString(font, "Player position:" + m_player.GetPosition().ToString(), new Vector2(0, 60), Color.White);
             * spriteBatch.DrawString(font, "Bullets currently:" + m_player.GetBullets().Count.ToString(), new Vector2(0, 80), Color.White);
             */

            spriteBatch.DrawString(font, "Player score: " + m_player.GetPlayerScore().ToString(), new Vector2(10, 50), Color.White);

            /*spriteBatch.DrawString(font, "Pawns:" + m_totalobjects.Count.ToString(), new Vector2(0, 120), Color.White);
            *  spriteBatch.DrawString(font, "Player rotation:" + m_player.m_playerrotation.ToString(), new Vector2(0, 140), Color.White);
            *  spriteBatch.DrawString(font, "Player Direction:" + m_player.GetPlayerDirection().ToString(), new Vector2(0, 160), Color.White);
            *  spriteBatch.DrawString(font, "Zoom amount:" + m_camera.Zoom.ToString(), new Vector2(0, 180), Color.White); */
            spriteBatch.End();

            #endregion

            m_player.Draw(spriteBatch, m_camera.Transform);



            spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, m_camera.Transform);

            foreach (EnemySpawner enemyspawner in m_enemyspawners)
            {
                enemyspawner.Draw(spriteBatch);

                //For debug purposes
                //enemyspawner.DrawInfo(spriteBatch, font);
            }

            foreach (DeathParticle deathparticle in m_deathparticles)
            {
                deathparticle.Draw(spriteBatch);
            }



            spriteBatch.End();

            spriteBatch.Begin(transformMatrix: Game1.m_scaleMatrix);
            JoystickLeft.Draw(spriteBatch);
            JoystickRight.Draw(spriteBatch);
            spriteBatch.End();


            // quadtree.Draw(spriteBatch, m_camera.Transform);
        }