예제 #1
0
        public void RunTick()
        {
            if (this.notifications.Count == 0 && this.incomingNotif is UIGroupNotify == false)
            {
                return;
            }

            UIGroupNotify delNotif = null;

            // Update the Incoming Notification Position, if applicable.
            if (this.incomingNotif is UIGroupNotify)
            {
                // Update the Incoming Notification's Y Total Movement.
                this.incomingMoved += 2;

                // We need to snap the Incoming Notification into place once it arrives.
                if (this.incomingMoved > this.incomingNotif.height)
                {
                    this.SendIncomingNotificationToList();
                }
            }

            // Loop through all notifications and process transitions, exit frames.
            foreach (var notif in this.notifications)
            {
                // Check Notification Exit Mechanics
                if (notif.exitFrame > 0 && notif.exitFrame <= Systems.timer.UniFrame)
                {
                    int finalFrame = notif.exitFrame + UIHandler.theme.notifs.exitDuration;

                    // Draw Fade Effect during the fade itself.
                    notif.alpha = 1 - Spectrum.GetPercentFromValue(Systems.timer.UniFrame, notif.exitFrame, finalFrame);

                    // Delete the notification if their exit has finalized.
                    if (Systems.timer.UniFrame > finalFrame)
                    {
                        delNotif = notif;
                    }
                }
            }

            // Remove a notification that was marked for deletion this frame.
            if (delNotif is UIGroupNotify)
            {
                this.notifications.Remove(delNotif);
            }
        }
예제 #2
0
        public void RunTick()
        {
            // Check Notification Exit Mechanics
            if (this.exitFrame > 0 && this.exitFrame <= Systems.timer.UniFrame)
            {
                int finalFrame = this.exitFrame + UIHandler.theme.notifs.exitDuration;

                // Draw Fade Effect during the fade itself.
                this.alpha = 1 - Spectrum.GetPercentFromValue(Systems.timer.UniFrame, this.exitFrame, finalFrame);

                // Delete the thisication if their exit has finalized.
                if (Systems.timer.UniFrame > finalFrame)
                {
                    this.alpha     = 0;
                    this.exitFrame = 0;
                }
            }
        }
예제 #3
0
파일: UIToolTip.cs 프로젝트: tarsupin/Nexus
        public void RunTick()
        {
            // Only Run Tool Tip Mechanics if it's been maintained.
            if (this.endFrame == 0)
            {
                return;
            }

            // Check Notification Exit Mechanics
            if (this.endFrame <= Systems.timer.UniFrame)
            {
                int finalFrame = this.endFrame + UIHandler.theme.tooltips.EndDuration;

                // Draw Fade Effect during the fade itself.
                this.alpha = 1 - Spectrum.GetPercentFromValue(Systems.timer.UniFrame, this.endFrame, finalFrame);

                // Clear the ToolTip mechanics if it's been ended.
                if (Systems.timer.UniFrame > finalFrame)
                {
                    this.endFrame = 0;
                }
            }
        }
예제 #4
0
파일: Radians.cs 프로젝트: tarsupin/Nexus
 public static float ConvertToPercent(float radian)
 {
     return(Spectrum.GetPercentFromValue(Radians.Wrap(radian), (0 - (float)Math.PI), (float)Math.PI));
 }
예제 #5
0
 // Conversions
 public static float ConvertToPercent(float degrees)
 {
     return(Spectrum.GetPercentFromValue(Radians.Wrap(degrees), -180f, 180f));
 }