Beispiel #1
0
        internal void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
        {
            Vector2 viewPosition = camera.GetVisualPositions(position);

            Vector2 visualRadius = camera.GetVisualPositions(smokeSize);

            Rectangle rect = new Rectangle((int)viewPosition.X, (int)viewPosition.Y, (int)visualRadius.X, (int)visualRadius.Y);

            Color color = new Color(visibility, visibility, visibility, visibility);

            spriteBatch.Draw(texture, viewPosition, null, color, rotation, new Vector2(origin, origin), size, SpriteEffects.None, 0);
        }
Beispiel #2
0
        internal void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
        {
            viewPosition = camera.GetVisualPositions(pos);
            Console.WriteLine(size);

            Vector2 visualSize = camera.GetVisualPositions(new Vector2(size,size));

            Rectangle rect = new Rectangle((int)viewPosition.X - (int)visualSize.X / 2, (int)viewPosition.Y - (int)visualSize.Y / 2, (int)visualSize.X, (int)visualSize.Y);

            Color color = new Color(visibility, visibility, visibility, visibility);

            spriteBatch.Draw(texture, rect, color);
        }
Beispiel #3
0
        internal void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
        {
            Vector2 viewPosition = camera.GetVisualPositions(position);

            Vector2 visualRadius = camera.GetVisualPositions(radius);

            Rectangle rect = new Rectangle((int)viewPosition.X, (int)viewPosition.Y, (int)visualRadius.X, (int)visualRadius.Y);

            float t = timeLivedSeconds/maxLifeTime;
            if (t > 1.0)
            {
                t = 1.0f;
            }
            float endValue = 0.0f;
            float startValue = 1.0f;
            float visibility = endValue * t + (1.0f - t) * startValue;

            Color color = new Color(visibility, visibility, visibility, visibility);

            spriteBatch.Draw(texture, rect, color);
        }