Exemplo n.º 1
0
        public override void Draw(SpriteBatch spriteBatch, Camera camera)
        {
            Vector2 temp = line.Stop - line.Start;
            float len = temp.Length();
            temp.Normalize();

            for (float i = 0; i < len; i += 1.0f)
            {
                spriteBatch.Draw(this.Texture, camera.RelativePosition(line.Start + Vector2.Multiply(temp, i)), Color.White);
            }

            spriteBatch.Draw(this.Texture, camera.RelativePosition(line.Stop), Color.White);
        }
Exemplo n.º 2
0
 public virtual void Draw(SpriteBatch spriteBatch, Camera camera)
 {
     if (Texture == null || !Alive)
         return;
     if (faceVector != null && rotateByFace)
         rotation = ((float)Math.Atan2(faceVector.Y, faceVector.X)) + (float)Math.PI / 2;
     GraphicalEntity ent = this;
     spriteBatch.Draw(Texture,
                      camera.RelativePosition(CenterPosition),
                      null,
                      Color.White,
                      rotation,
                      (Bounds / Scale) / 2,
                      Scale * camera.zoom,
                      SpriteEffects.None,
                      0);
 }