コード例 #1
0
        public void ResizeWindow()
        {
            Size size = Size;

            size.Width  = MathExtension.Max(Setting.barX) + Setting.width + penWidth;
            size.Height = moveRectHeight + Setting.height;
            Size        = size;
        }
コード例 #2
0
        private void TimeManager_OnUpdate()
        {
            sheetWindow.Refresh();

            if (IsPlaying)
            {
                double t     = GetTimeRatio();
                int    value = MathExtension.Lerp(0, 100, t);
                progressBar.Value = value;

                ElapsedTime += TimeManager.DeltaTime;
            }
            else
            {
                progressBar.Value = 0;
            }
        }
コード例 #3
0
        private void DrawMoveRect(Graphics g)
        {
            Rectangle rect = new Rectangle(0, 0, Width - penWidth, moveRectHeight + penWidth);

            g.FillRectangle(moveRectBrush, rect.X, rect.Y, rect.Width, rect.Height);
            g.DrawRectangle(moveRectPen, rect.X, rect.Y, rect.Width, rect.Height);

            if (player.IsPlaying)
            {
                double    t        = player.GetTimeRatio();
                int       w        = MathExtension.Lerp(0, Width, t);
                Rectangle timeRect = new Rectangle(0, 0, w - penWidth, timeRectHeight + penWidth);
                g.FillRectangle(timeRectBrush, timeRect.X, timeRect.Y, timeRect.Width, timeRect.Height);
                g.DrawRectangle(moveRectPen, timeRect.X, timeRect.Y, timeRect.Width, timeRect.Height);
            }

            if (player.IsLoaded)
            {
                Rectangle nameRect = new Rectangle(0, timeRectHeight, Width, moveRectHeight - penWidth);
                DrawText(g, nameRect, player.GetMusicName(), nearStringFormat);
                DrawText(g, nameRect, player.GetBPM(), farStringFormat);
            }
        }