public override void Draw(CustomSpriteBatch g)
        {
            if (ActiveAnimationBackground != null)
            {
                g.End();
                ActiveAnimationBackground.Draw(g, Constants.Width, Constants.Height);
                g.Begin();
            }

            for (int A = 0; A < ListAnimationLayer.BasicLayerCount; A++)
            {
                if (ListAnimationLayer[A].ListPolygonCutter.Count > 0)
                {
                    PolygonEffect.Texture = ListAnimationLayer[A].renderTarget;
                    PolygonEffect.CurrentTechnique.Passes[0].Apply();

                    GraphicsDevice.RasterizerState = RasterizerState.CullNone;

                    for (int P = 0; P < ListAnimationLayer[A].ListPolygonCutter.Count; P++)
                    {
                        ListAnimationLayer[A].ListPolygonCutter[P].Draw(g, false);
                    }
                }
                else
                {
                    if (IsLeftAttacking)
                    {
                        g.Draw(ListAnimationLayer[A].renderTarget, new Rectangle(Constants.Width / 2, Constants.Height / 2, Constants.Width, Constants.Height), null, Color.White, 0, new Vector2(ScreenWidth / 2, ScreenHeight / 2), SpriteEffects.FlipHorizontally, 0);
                    }
                    else
                    {
                        g.Draw(ListAnimationLayer[A].renderTarget, new Rectangle(0, 0, Constants.Width, Constants.Height), null, Color.White);
                    }
                }

                if (A == 0 && ActiveAnimationForeground != null)
                {
                    if (ActiveAnimationForeground != null)
                    {
                        g.End();
                        ActiveAnimationForeground.Draw(g, Constants.Width, Constants.Height);
                        g.Begin();
                    }
                }
            }
        }
        public virtual void DrawEditor(CustomSpriteBatch g, int ScreenWidth, int ScreenHeight, bool IsInEditMode, bool ShowBorderBoxes, bool ShowNextPositions)
        {
            GraphicsDevice.SetRenderTarget(null);
            GraphicsDevice.Clear(Color.White);

            if (ActiveAnimationBackground != null)
            {
                ActiveAnimationBackground.Draw(g, ScreenWidth, ScreenHeight);
            }

            g.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise);

            for (int L = 0; L < ListAnimationLayer.Count; L++)
            {
                AnimationLayer ActiveLayer = ListAnimationLayer[L];

                if (ActiveLayer.ListPolygonCutter.Count > 0)
                {
                    g.End();
                    g.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise);

                    PolygonEffect.Texture = ActiveLayer.renderTarget;
                    PolygonEffect.CurrentTechnique.Passes[0].Apply();

                    GraphicsDevice.RasterizerState = RasterizerState.CullNone;

                    for (int P = 0; P < ActiveLayer.ListPolygonCutter.Count; P++)
                    {
                        ActiveLayer.ListPolygonCutter[P].Draw(g, IsInEditMode);
                    }
                }

                if (IsInEditMode || ActiveLayer.ListPolygonCutter.Count <= 0)
                {
                    g.Draw(ActiveLayer.renderTarget, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.1f);
                }
            }

            g.End();

            //Draw HUD
            DrawOverlay(g);
        }
        public override void Draw(CustomSpriteBatch g)
        {
            g.End();
            if (ActiveAnimationBackground != null)
            {
                ActiveAnimationBackground.Draw(g, Constants.Width, Constants.Height);
            }
            g.Begin();

            for (int A = ListAnimationLayer.Count - 1; A >= 0; --A)
            {
                if (ListAnimationLayer[A].ListPolygonCutter.Count > 0)
                {
                    PolygonEffect.Texture = ListAnimationLayer[A].renderTarget;
                    PolygonEffect.CurrentTechnique.Passes[0].Apply();

                    GraphicsDevice.RasterizerState = RasterizerState.CullNone;

                    for (int P = 0; P < ListAnimationLayer[A].ListPolygonCutter.Count; P++)
                    {
                        ListAnimationLayer[A].ListPolygonCutter[P].Draw(g, false);
                    }
                }
                else
                {
                    if (IsLeftAttacking)
                    {
                        g.Draw(ListAnimationLayer[A].renderTarget, new Vector2(Constants.Width / 2, Constants.Height / 2), null, Color.White, 0, new Vector2(Constants.Width / 2, Constants.Height / 2), 1, SpriteEffects.FlipHorizontally, 0);
                    }
                    else
                    {
                        g.Draw(ListAnimationLayer[A].renderTarget, Vector2.Zero, Color.White);
                    }
                }
            }

            g.End();
            g.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);

            DrawBox(g, new Vector2(0, 0), Constants.Width / 2, 84, Color.Red);
            int PosX = 0;

            DrawBar(g, sprBarExtraLargeBackground, sprBarExtraLargeHP, new Vector2(PosX + 75, 30), UnitStats.LeftUnitHP, UnitStats.LeftUnitHPMax);
            DrawBar(g, sprBarExtraLargeBackground, sprBarExtraLargeEN, new Vector2(PosX + 75, 50), UnitStats.LeftUnitEN, UnitStats.LeftUnitENMax);
            g.DrawString(fntFinlanderFont, "HP", new Vector2(PosX + 40, 20), Color.Yellow);
            g.DrawStringRightAligned(fntFinlanderFont, UnitStats.LeftUnitHP + "/" + UnitStats.LeftUnitHPMax, new Vector2(PosX + 242, 17), Color.White);
            g.DrawString(fntFinlanderFont, "EN", new Vector2(PosX + 40, 40), Color.Yellow);
            g.DrawStringRightAligned(fntFinlanderFont, UnitStats.LeftUnitEN + "/" + UnitStats.LeftUnitENMax, new Vector2(PosX + 242, 37), Color.White);
            g.Draw(LeftSquad.CurrentLeader.SpriteMap, new Vector2(PosX + 7, 30), Color.White);

            PosX = Constants.Width / 2 + 68;
            DrawBox(g, new Vector2(Constants.Width / 2, 0), Constants.Width / 2, 84, Color.Blue);
            DrawBar(g, sprBarExtraLargeBackground, sprBarExtraLargeHP, new Vector2(PosX + 75, 30), UnitStats.RightUnitHP, UnitStats.RightUnitHPMax);
            DrawBar(g, sprBarExtraLargeBackground, sprBarExtraLargeEN, new Vector2(PosX + 75, 50), UnitStats.RightUnitEN, UnitStats.RightUnitENMax);
            g.DrawString(fntFinlanderFont, "HP", new Vector2(PosX + 40, 20), Color.Yellow);
            g.DrawStringRightAligned(fntFinlanderFont, UnitStats.RightUnitHP + "/" + UnitStats.RightUnitHPMax, new Vector2(PosX + 242, 17), Color.White);
            g.DrawString(fntFinlanderFont, "EN", new Vector2(PosX + 40, 40), Color.Yellow);
            g.DrawStringRightAligned(fntFinlanderFont, UnitStats.RightUnitEN + "/" + UnitStats.RightUnitENMax, new Vector2(PosX + 242, 37), Color.White);
            g.Draw(RightSquad.CurrentLeader.SpriteMap, new Vector2(PosX + 7, 30), Color.White);
            g.Draw(sprInfinity, new Vector2((Constants.Width - sprInfinity.Width) / 2, 15), Color.White);

            DrawBox(g, new Vector2(0, Constants.Height - VNBoxHeight), Constants.Width, VNBoxHeight, Color.White);

            if (ActiveCharacter != null)
            {
                if (ActiveCharacter.IsAnimated)
                {
                    for (int L = ActiveCharacter.ActiveAnimation.ListAnimationLayer.Count - 1; L >= 0; --L)
                    {
                        int OriginX = (int)ActiveCharacter.ActiveAnimation.AnimationOrigin.Position.X;

                        g.Draw(ActiveCharacter.ActiveAnimation.ListAnimationLayer[L].renderTarget,
                               new Vector2(0, Constants.Height - VNBoxHeight), null, Color.White, 0,
                               new Vector2(OriginX, ActiveCharacter.ActiveAnimation.AnimationOrigin.Position.Y),
                               new Vector2(1, 1), SpriteEffects.None, 0);
                    }
                }
                else
                {
                    g.Draw(ActiveCharacter.StaticSprite,
                           new Rectangle(30, Constants.Height - VNBoxHeight + 40, ActiveCharacter.StaticSprite.Width, ActiveCharacter.StaticSprite.Height),
                           new Rectangle(0, 0, ActiveCharacter.StaticSprite.Width, ActiveCharacter.StaticSprite.Height), Color.White, 0, Vector2.Zero, SpriteEffects.FlipHorizontally, 0);
                }
            }

            g.DrawString(fntFinlanderFont, ExtraText, new Vector2(25, Constants.Height - VNBoxHeight + 10), Color.White);

            if (ActiveQuoteSet != null)
            {
                g.DrawString(fntFinlanderFont, ActiveQuoteSet, new Vector2(125, Constants.Height - VNBoxHeight + 40), Color.White);
            }

            g.End();
            g.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
        }