Esempio n. 1
0
        public virtual void Draw()
        {
            if (!Visible)
            {
                return;
            }

            var res = UIMenu.GetScreenResolutionMantainRatio();

            if (UseDynamicPositionment)
            {
                SafeSize = new PointF(300, 240);

                TopLeft     = new PointF(SafeSize.X, SafeSize.Y);
                BottomRight = new PointF((int)res.Width - SafeSize.X, (int)res.Height - SafeSize.Y);
            }

            var rectSize = new SizeF(BottomRight.SubtractPoints(TopLeft));

            DrawInstructionalButtons?.Invoke(this, EventArgs.Empty);

            if (DrawBg)
            {
                new UIResRectangle(TopLeft, rectSize,
                                   Color.FromArgb((Focused || !FadeInWhenFocused) ? 200 : 120, 0, 0, 0)).Draw();

                var tileSize = 100;
                RockstarTile.Size = new SizeF(tileSize, tileSize);

                var cols = (int)rectSize.Width / tileSize;
                var fils = 4;

                for (int i = 0; i < cols * fils; i++)
                {
                    RockstarTile.Position = TopLeft.AddPoints(new PointF(tileSize * (i % cols), tileSize * (i / cols)));
                    RockstarTile.Color    = Color.FromArgb((int)MiscExtensions.LinearFloatLerp(40, 0, i / cols, fils), 255, 255, 255);
                    RockstarTile.Draw();
                }
            }
        }