Exemple #1
0
        protected override void Draw()
        {
            if (scale < destScale)
            {
                scale += 1f * Time.DeltaDrawTime;
            }
            if (scale > destScale)
            {
                scale -= 1f * Time.DeltaDrawTime;
            }

            element.Size = origSize * scale * MathF.Min(InnerDimensions.Width / origSize.X, InnerDimensions.Height / origSize.Y);

            Renderer2D.DrawQuadTL(Dimensions.Position, Dimensions.Size, BorderColor);
            Renderer2D.DrawQuadTL(Dimensions.Position + new Vector2(2f), Dimensions.Size - new Vector2(4f), IsMouseHovering ? HoveredColor : BackgroundColor);

            if (element is CircularMirror mirror)
            {
                mirror.UIDraw();
            }
            else
            {
                element.Draw();
            }

            Renderer2D.DrawQuadTL(Dimensions.Position + new Vector2(2f, Dimensions.Height - 22f), new Vector2(Dimensions.Width - 4f, 20f), IsMouseHovering ? HoveredColor : BackgroundColor);
            size = Renderer2D.DrawString(Localization.GetTranslation(element.GetType().Name), InnerDimensions.X + InnerDimensions.Width * 0.5f - size.X * 0.5f, InnerDimensions.Y + InnerDimensions.Height - size.Y - 2f, scale: 0.4f);
        }