/// <summary>
            /// Draws the <see cref="ITransBox"/>.
            /// </summary>
            /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param>
            /// <param name="camera">The <see cref="ICamera2D"/>.</param>
            public void Draw(ISpriteBatch spriteBatch, ICamera2D camera)
            {
                var p = camera.ToScreen(Position).Round();
                var s = Size.Round();
                var r = new Rectangle((int)p.X, (int)p.Y, (int)s.X, (int)s.Y);

                SystemSprites.Move.Draw(spriteBatch, r, Color.White);
            }
            /// <summary>
            /// Draws the <see cref="ITransBox"/>.
            /// </summary>
            /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param>
            /// <param name="camera">The <see cref="ICamera2D"/>.</param>
            public void Draw(ISpriteBatch spriteBatch, ICamera2D camera)
            {
                Vector2   p = camera.ToScreen(Position).Round();
                Vector2   s = Size.Round();
                Rectangle r = new Rectangle(p.X, p.Y, s.X, s.Y);

                SystemSprites.Move.Draw(spriteBatch, r, Color.White);
            }
            /// <summary>
            /// Draws the <see cref="ITransBox"/>.
            /// </summary>
            /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param>
            /// <param name="camera">The <see cref="ICamera2D"/>.</param>
            public void Draw(ISpriteBatch spriteBatch, ICamera2D camera)
            {
                var sprite = GetSprite(_type);

                if (sprite == null)
                {
                    return;
                }

                var p = camera.ToScreen(Position).Round();
                var s = Size.Round();
                var r = new Rectangle((int)p.X, (int)p.Y, (int)s.X, (int)s.Y);


                p = camera.ToScreen(GetPosition() + Vector2.One).Round();
                bool okFlag = false;

                if (ContainsPoint(camera.ToWorld(p)))   // Something went right
                {
                    okFlag = true;
                }

                var newR = new Rectangle((int)p.X, (int)p.Y, (int)s.X, (int)s.Y);

                sprite.Draw(spriteBatch, r, Color.White);

                // Draw a marker at ACTUAL transbox positions for debug purposes.
                if (okFlag)
                {
                    sprite.Draw(spriteBatch, newR, Color.Green);
                }
                else
                {
                    sprite.Draw(spriteBatch, newR, Color.Red);
                }
            }
            /// <summary>
            /// Draws the <see cref="ITransBox"/>.
            /// </summary>
            /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param>
            /// <param name="camera">The <see cref="ICamera2D"/>.</param>
            public void Draw(ISpriteBatch spriteBatch, ICamera2D camera)
            {
                var sprite = GetSprite(_type);

                if (sprite == null)
                {
                    return;
                }

                Vector2   p = camera.ToScreen(Position).Round();
                Vector2   s = Size.Round();
                Rectangle r = new Rectangle(p.X, p.Y, s.X, s.Y);

                sprite.Draw(spriteBatch, r, Color.Green);
            }
 /// <summary>
 /// Draws the <see cref="ITransBox"/>.
 /// </summary>
 /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param>
 /// <param name="camera">The <see cref="ICamera2D"/>.</param>
 public void Draw(ISpriteBatch spriteBatch, ICamera2D camera)
 {
     var p = camera.ToScreen(Position).Round();
     var s = Size.Round();
     var r = new Rectangle((int)p.X, (int)p.Y, (int)s.X, (int)s.Y);
     SystemSprites.Move.Draw(spriteBatch, r, Color.White);
 }
 /// <summary>
 /// Draws the <see cref="ITransBox"/>.
 /// </summary>
 /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param>
 /// <param name="camera">The <see cref="ICamera2D"/>.</param>
 public void Draw(ISpriteBatch spriteBatch, ICamera2D camera)
 {
     Vector2 p = camera.ToScreen(Position).Round();
     Vector2 s = Size.Round();
     Rectangle r = new Rectangle(p.X, p.Y, s.X, s.Y);
     SystemSprites.Move.Draw(spriteBatch, r, Color.White);
 }
            /// <summary>
            /// Draws the <see cref="ITransBox"/>.
            /// </summary>
            /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param>
            /// <param name="camera">The <see cref="ICamera2D"/>.</param>
            public void Draw(ISpriteBatch spriteBatch, ICamera2D camera)
            {
                var sprite = GetSprite(_type);
                if (sprite == null)
                    return;

                var p = camera.ToScreen(Position).Round();
                var s = Size.Round();
                var r = new Rectangle((int)p.X, (int)p.Y, (int)s.X, (int)s.Y);


                p = camera.ToScreen(GetPosition() + Vector2.One).Round();
                bool okFlag = false;

                if (ContainsPoint(camera.ToWorld(p)))   // Something went right
                    okFlag = true;

                var newR = new Rectangle((int)p.X, (int)p.Y, (int)s.X, (int)s.Y);

                sprite.Draw(spriteBatch, r, Color.White);

                // Draw a marker at ACTUAL transbox positions for debug purposes.
                if (okFlag)
                sprite.Draw(spriteBatch, newR, Color.Green);
                else
                    sprite.Draw(spriteBatch, newR, Color.Red);



                

            }
Esempio n. 8
0
            /// <summary>
            /// Draws the <see cref="ITransBox"/>.
            /// </summary>
            /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param>
            /// <param name="camera">The <see cref="ICamera2D"/>.</param>
            public void Draw(ISpriteBatch spriteBatch, ICamera2D camera)
            {
                var sprite = GetSprite(_type);
                if (sprite == null)
                    return;

                Vector2 p = camera.ToScreen(Position).Round();
                Vector2 s = Size.Round();
                Rectangle r = new Rectangle(p.X, p.Y, s.X, s.Y);
                sprite.Draw(spriteBatch, r, Color.Green);
            }