public void Draw(RenderTarget target, RenderStates states)
        {
            states.Transform     *= Transform;
            InternalText.Origin   = new Vector2f(0, InternalText.CharacterSize / 2);
            InternalText.Position = new Vector2f(0, Bar.Size.Y / 2);
            target.Draw(Utilities.ApplyTexture(InternalText, InternalText.GetGlobalBounds(), TextImage, InternalText.GetBorderColor().MakeTransparent()), states);
            var tr = Transform.Identity;

            tr.Translate(InternalText.GetGlobalBounds().Width + 5, 0);
            states.Transform *= tr;
            target.Draw(new RectangleShape {
                Size = (Vector2f)Bar.Size, Texture = Back
            }, states);
            var scale = ImgHeight / Bar.Size.Y;

            if ((Style & Template.Gauge.VERTICAL) == 0)
            {
                var rect = new RectangleShape(new Vector2f(Bar.Size.X * Value / Max, Bar.Size.Y))
                {
                    Scale = new Vector2f(scale, scale)
                };
                rect.Texture = Bar;
                if ((Style & Template.Gauge.LEFT) != 0)
                {
                    rect.TextureRect = new IntRect(0, 0, (int)(Bar.Size.X * Value / Max), (int)Bar.Size.Y);
                }
                else if ((Style & Template.Gauge.RIGHT) != 0)
                {
                    rect.TextureRect = new IntRect((int)(Bar.Size.X * (Max - Value) / Max), 0, (int)(Bar.Size.X * Value / Max), (int)Bar.Size.Y);
                    rect.Position    = new Vector2f(Back.Size.X, 0);
                    rect.Origin      = new Vector2f(rect.Size.X, 0);
                }
                else
                {
                    rect.TextureRect = new IntRect((int)(Bar.Size.X / 2 - Bar.Size.X * Value / Max / 2), 0, (int)(Bar.Size.X * Value / Max), (int)Bar.Size.Y);
                    rect.Position    = new Vector2f(Back.Size.X / 2, 0);
                    rect.Origin      = new Vector2f(rect.Size.X / 2, 0);
                }
                target.Draw(rect, states);
            }
            else
            {
                var rect = new RectangleShape(new Vector2f(Bar.Size.X, Bar.Size.Y * Value / Max))
                {
                    Scale = new Vector2f(scale, scale)
                };
                rect.Texture = Bar;
                if ((Style & Template.Gauge.LEFT) != 0)
                {
                    rect.TextureRect = new IntRect(0, 0, (int)Bar.Size.X, (int)(Bar.Size.Y * Value / Max));
                }
                else if ((Style & Template.Gauge.RIGHT) != 0)
                {
                    rect.TextureRect = new IntRect(0, (int)(Bar.Size.Y * (Max - Value) / Max), (int)Bar.Size.X, (int)(Bar.Size.Y * Value / Max));
                    rect.Position    = new Vector2f(0, Back.Size.Y);
                    rect.Origin      = new Vector2f(0, rect.Size.Y);
                }
                else
                {
                    rect.TextureRect = new IntRect(0, (int)(Bar.Size.Y / 2 - Bar.Size.Y * Value / Max / 2), (int)Bar.Size.X, (int)(Bar.Size.Y * Value / Max));
                    rect.Position    = new Vector2f(0, Back.Size.Y / 2);
                    rect.Origin      = new Vector2f(0, rect.Size.Y / 2);
                }
                target.Draw(rect, states);
                if (drawOutline)
                {
                    target.Draw(new RectangleShape(new Vector2f(Bounds.Width, Bounds.Height))
                    {
                        OutlineColor = Color.Green, OutlineThickness = -1, FillColor = Color.Transparent
                    }, states);
                }
            }
        }
        public void Draw(RenderTarget target, RenderStates states)
        {
            int Hspace = (int)(Icons.First().Size.Y *(float)Icons.First().Size.X / Icons.First().Size.Y + 4);
            int Vspace = (int)Icons.First().Size.Y + 4;

            InternalText.Origin = new Vector2f(0, InternalText.CharacterSize / 2);
            if ((Style & Template.Counter.VERTICAL) == 0)
            {
                InternalText.Position = new Vector2f(0, (int)Math.Max(InternalText.CharacterSize, (Style & (Template.Counter.ALT1 | Template.Counter.ALT2)) != 0 ? Icons.First().Size.Y * 1.5f : Icons.First().Size.Y) / 2);
            }
            else
            {
                InternalText.Position = new Vector2f(0, (int)Math.Max(InternalText.CharacterSize, (Style & (Template.Counter.ALT1 | Template.Counter.ALT2)) != 0 ? Vspace * .5f * (Max - 1) : Vspace * (Max - 1)) / 2);
            }
            states.Transform *= Transform;
            var initialStates = states;

            target.Draw(Utilities.ApplyTexture(InternalText, InternalText.GetGlobalBounds(), TextImage, InternalText.GetBorderColor().MakeTransparent()), states);
            var tr = Transform.Identity;

            tr.Translate(InternalText.GetGlobalBounds().Width + 5, 0);
            states.Transform *= tr;
            if ((Style & Template.Counter.STACKED) != 0)
            {
                Texture toDraw = null;
                var     index  = Math.Min(Value - 1, Icons.Count);
                if (index == 0 && Back.Count > 0)
                {
                    toDraw = Back.First();
                }
                else if (index > 0)
                {
                    toDraw = Icons[index];
                }
                var ratio = (float)toDraw.Size.X / toDraw.Size.Y;
                var scale = ImgHeight / toDraw.Size.Y;
                var rect  = new Sprite(toDraw)
                {
                    Scale = new Vector2f(scale, scale)
                };
                target.Draw(rect, states);
            }
            else
            {
                void disp(Texture toDraw, Vector2f whereToDraw)
                {
                    var scale = ImgHeight / toDraw.Size.Y;

                    target.Draw(new Sprite
                    {
                        Position = whereToDraw,
                        Texture  = toDraw,
                        Scale    = new Vector2f(scale, scale)
                    }, states);
                }

                for (int i = 1; i <= Max; i++)
                {
                    Vector2f position;
                    if ((Style & Template.Counter.VERTICAL) != 0)
                    {
                        if ((Style & Template.Counter.ALT1) != 0)
                        {
                            position = new Vector2f(Hspace / 2 * ((i + 1) % 2), (i - 1) * Vspace / 2);
                        }
                        else if ((Style & Template.Counter.ALT2) != 0)
                        {
                            position = new Vector2f(Hspace / 2 * (i % 2), (i - 1) * Vspace / 2);
                        }
                        else
                        {
                            position = new Vector2f(0, (i - 1) * Vspace);
                        }
                        if ((Style & Template.Counter.RIGHT) != 0)
                        {
                            position.Y = (Max - 1) * Vspace * ((Style & (Template.Counter.ALT1 | Template.Counter.ALT2)) != 0 ? .5f : 1) - position.Y;
                        }
                    }
                    else
                    {
                        if ((Style & Template.Counter.ALT1) != 0)
                        {
                            position = new Vector2f((i - 1) * Hspace / 2, Vspace / 2 * ((i + 1) % 2));
                        }
                        else if ((Style & Template.Counter.ALT2) != 0)
                        {
                            position = new Vector2f((i - 1) * Hspace / 2, Vspace / 2 * (i % 2));
                        }
                        else
                        {
                            position = new Vector2f((i - 1) * Hspace, 0);
                        }
                        if ((Style & Template.Counter.RIGHT) != 0)
                        {
                            position.X = (Max - 1) * Hspace * ((Style & (Template.Counter.ALT1 | Template.Counter.ALT2)) != 0 ? .5f : 1) - position.X;
                        }
                    }
                    if (Value >= i)
                    {
                        disp(Icons[Math.Min(Icons.Count - 1, i - 1)], position);
                    }
                    else if (Back.Count > 0)
                    {
                        disp(Back[Math.Min(Back.Count - 1, i - 1)], position);
                    }
                }
            }
            if (drawOutline)
            {
                target.Draw(new RectangleShape(new Vector2f(Bounds.Width, Bounds.Height))
                {
                    OutlineColor = Color.Green, OutlineThickness = -1, FillColor = Color.Transparent
                }, initialStates);
            }
        }