Exemplo n.º 1
0
 public static void Draw <T>(IList <T> list, SpriteBatchS spriteBatch)
 {
     for (int i = 0; i < list.Count; i++)
     {
         (list[i] as Drawable).Draw(spriteBatch);
     }
 }
Exemplo n.º 2
0
 public void Draw(SpriteBatchS spriteBatch)
 {
     if (!active || CustomDraw(spriteBatch))
     {
         return;
     }
     if (dynamicTexture == null)
     {
         spriteBatch.Draw(texture, position, null, color, rotation, Vector2.Zero, scale, flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
     }
     else
     {
         dynamicTexture.Draw(spriteBatch, position, null, color, rotation, Vector2.Zero, scale, flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
     }
 }
Exemplo n.º 3
0
        public override bool CustomDraw(SpriteBatchS spriteBatch)
        {
            float t = 1;

            if (timeLeft < 100)
            {
                t = timeLeft / 100f;
            }
            if (timeLeft > 146)
            {
                t = 0;
            }
            if (Ste.Quality > 2)
            {
                for (int i = 0; i < oldPosLength; i++)
                {
                    if (oldPositon[i] == Vector2.Zero)
                    {
                        break;
                    }
                    if (oldPositon.TryGetValue(i + 1) == Vector2.Zero)
                    {
                        continue;
                    }
                    float m = (oldPositon[i] - oldPositon.TryGetValue(i + 1)).Length() * 0.4f;
                    for (int j = 0; j < m; j++)
                    {
                        if (i == 0 && j == 0)
                        {
                            flarefx.Draw(spriteBatch, oldPositon[i].LerpTo(oldPositon.TryGetValue(i + 1), j, m), null, drawColor * 1.6f * t, 0.7853f, new Vector2(20, 20), 1.4f * (1f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))), SpriteEffects.None, 0f);
                        }
                        else
                        {
                            flarefxAlt.Draw(spriteBatch, oldPositon[i].LerpTo(oldPositon.TryGetValue(i + 1), j, m), null, color.LerpTo(drawColor, (oldPosLength - i) * (oldPosLength - i), oldPosLength * oldPosLength * 1.6f) * (1f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))) * t, 0.7853f, new Vector2(20, 20), 1.1f * (1f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))), SpriteEffects.None, 0f);
                        }
                    }
                }
            }
            else if (Ste.Quality != 0)
            {
                for (int i = 0; i < oldPosLength / 2; i++)
                {
                    if (oldPositon[i] == Vector2.Zero)
                    {
                        break;
                    }
                    if (oldPositon.TryGetValue(i + 1) == Vector2.Zero)
                    {
                        continue;
                    }
                    float m = (oldPositon[i] - oldPositon.TryGetValue(i + 1)).Length() * 0.05f;
                    for (int j = 0; j < m; j++)
                    {
                        if (i == 0 && j == 0)
                        {
                            flarefx.Draw(spriteBatch, oldPositon[i].LerpTo(oldPositon.TryGetValue(i + 1), j, m), null, drawColor * 1.4f * t, 0.7853f, new Vector2(20, 20), 1.3f * (1f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))), SpriteEffects.None, 0f);
                        }
                        else
                        {
                            flarefxAlt.Draw(spriteBatch, oldPositon[i].LerpTo(oldPositon.TryGetValue(i + 1), j, m), null, color.LerpTo(drawColor, (oldPosLength - i) * (oldPosLength - i), oldPosLength * oldPosLength) * (1.55f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))) * t, 0.7853f, new Vector2(20, 20), 1.8f * (1f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))), SpriteEffects.None, 0f);
                        }
                    }
                }
            }
            else
            {
                for (int i = 0; i < oldPosLength / 4; i++)
                {
                    if (oldPositon[i] == Vector2.Zero)
                    {
                        break;
                    }
                    if (oldPositon.TryGetValue(i + 1) == Vector2.Zero)
                    {
                        continue;
                    }
                    if (i == 0)
                    {
                        flarefx.Draw(spriteBatch, oldPositon[i], null, drawColor * 1.4f * t, 0.7853f, new Vector2(20, 20), 1.3f * (1f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))), SpriteEffects.None, 0f);
                    }
                    else
                    {
                        flarefxAlt.Draw(spriteBatch, oldPositon[i], null, color.LerpTo(drawColor, (oldPosLength - i) * (oldPosLength - i), oldPosLength * oldPosLength) * (1.55f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))) * t, 0.7853f, new Vector2(20, 20), 1.8f * (1f - (float)(Math.Sqrt(i) / Math.Sqrt(oldPosLength))), SpriteEffects.None, 0f);
                    }
                }
            }
            return(true);
        }
Exemplo n.º 4
0
 public static void Draw(SpriteBatchS spriteBatch)
 {
     Draw(players, spriteBatch);
     Draw(npcs, spriteBatch);
     Draw(bullets, spriteBatch);
 }
Exemplo n.º 5
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatchS(GraphicsDevice);
 }
Exemplo n.º 6
0
 public virtual bool CustomDraw(SpriteBatchS spriteBatch)
 {
     return(false);
 }