예제 #1
0
 public static void DrawToLane(System.Drawing.Graphics g, IReadOnlyEditorLaneEnvironment env, NoteBase note)
 {
     // NOTE: お試し実装
     using (var sb = new SolidBrush(NoteGraphicsGenerator.GetColor(note.NoteType)))
         using (var pen = new Pen(Color.White))
         {
             g.Clip = new Region(env.LaneRect);
             var rect = note.GetRectangle(env);
             if (note.NoteType == NoteType.HoldRelay)
             {
                 g.DrawRectangle(pen, rect);
             }
             else
             {
                 g.FillRectangle(sb, rect);
             }
             DrawToLanePreviewNoteFrame(g, rect, note as PreviewNote);
             // 水平位置を1周分ずらしてもう一回描画
             rect.X -= (int)(MadcaEnv.LaneCount * env.LaneUnitWidth);
             if (note.NoteType == NoteType.HoldRelay)
             {
                 g.DrawRectangle(pen, rect);
             }
             else
             {
                 g.FillRectangle(sb, rect);
             }
             DrawToLanePreviewNoteFrame(g, rect, note as PreviewNote);
             g.ResetClip();
         }
 }
예제 #2
0
 private static void DrawToLanePreviewNoteFrame(System.Drawing.Graphics g, Rectangle rect, PreviewNote note)
 {
     if (note == null)
     {
         return;
     }
     using (var pen = new Pen(NoteGraphicsGenerator.GetColor(note.SelectedNote)))
     {
         g.DrawRectangle(pen, rect);
     }
 }
예제 #3
0
        public static void DrawToPreview(System.Drawing.Graphics g, IReadOnlyPreviewDisplayEnvironment env, NoteBase note)
        {
            var   diff = note.Timing - env.TimingOffset;
            float r    = 1 - (float)(diff / env.TimingLength).BarRatio;

            if (r <= 0 || r > 1)
            {
                return;
            }
            var   lane1    = note.Lane.NormalizedLane;
            float startDeg = CalcCsDeg(6 * lane1);
            float degSize  = CalcCsDegSize(6 * note.NoteSize.Size);

            using (var p = new Pen(NoteGraphicsGenerator.GetColor(note.NoteType), 5))
            {
                r *= env.Radius;
                g.DrawArc(p, env.CenterPoint.X - r, env.CenterPoint.Y - r, 2 * r, 2 * r, startDeg, degSize);
            }
        }