MainMenuDraw() static private method

The main menu draw.
static private MainMenuDraw ( Menu menu, double add ) : void
menu Menu /// The menu. ///
add double /// The add. ///
return void
Beispiel #1
0
        /// <summary>
        ///     The drawing_ on draw.
        /// </summary>
        /// <param name="args">
        ///     The args.
        /// </param>
        public void Drawing_OnDraw(EventArgs args)
        {
            if (!Game.IsInGame)
            {
                return;
            }

            if (!this.Visible)
            {
                return;
            }

            var wasHovered = this.hovered;

            this.hovered = Utils.IsUnderRectangle(
                Game.MouseScreenPosition,
                this.Position.X,
                this.Position.Y,
                this.Width,
                this.Height);
            if (!wasHovered && this.hovered)
            {
                this.transition.Start(0, this.Height);
            }
            else if (wasHovered && !this.hovered)
            {
                this.transition.Start(0, this.Height);
            }

            var add = this.hovered
                          ? this.transition.GetValue() * 0.1
                          : this.transition.GetValue() > 0 || this.transition.Moving
                              ? (this.Height - this.transition.GetValue()) * 0.1
                              : 0;

            MenuUtils.MainMenuDraw(this, add);
        }