private void DrawTapNote(RenderContext context, double now, Note note) { if (!NotesLayerUtils.IsNoteOnStage(note, now)) { return; } float x = NotesLayerUtils.GetNoteXPosition(context, now, note), y = NotesLayerUtils.GetNoteYPosition(context, now, note), r = NotesLayerUtils.GetNoteRadius(now, note); DrawNoteImage(context, note, x, y, r); }
private static void DrawSyncLine(RenderContext context, double now, Note note1, Note note2) { if (!NotesLayerUtils.IsNoteOnStage(note1, now) || !NotesLayerUtils.IsNoteOnStage(note2, now)) { return; } float x1 = NotesLayerUtils.GetNoteXPosition(context, now, note1), y = NotesLayerUtils.GetNoteYPosition(context, now, note2), x2 = NotesLayerUtils.GetNoteXPosition(context, now, note2); float r = NotesLayerUtils.GetNoteRadius(now, note2); float xLeft = Math.Min(x1, x2), xRight = Math.Max(x1, x2); context.DrawLine(SyncLinePen, xLeft + r, y, xRight - r, y); }
private void DrawFlickNote(RenderContext context, double now, Note note) { if (!NotesLayerUtils.IsNoteOnStage(note, now)) { return; } if (note.FlickType == NoteFlickType.None) { Debug.Print("WARNING: Tap/hold/slide note requested in DrawFlickNote."); return; } float x = NotesLayerUtils.GetNoteXPosition(context, now, note), y = NotesLayerUtils.GetNoteYPosition(context, now, note), r = NotesLayerUtils.GetNoteRadius(now, note); DrawNoteImage(context, note, x, y, r); }
private void DrawSlideNote(RenderContext context, double now, Note note) { if (note.FlickType != NoteFlickType.None) { DrawFlickNote(context, now, note); return; } float x, y, r; if (note.IsSlideEnd || NotesLayerUtils.IsNoteOnStage(note, now)) { x = NotesLayerUtils.GetNoteXPosition(context, now, note); y = NotesLayerUtils.GetNoteYPosition(context, now, note); r = NotesLayerUtils.GetNoteRadius(now, note); } else if (NotesLayerUtils.IsNotePassed(note, now)) { if (!note.HasNextFlickOrSlide || NotesLayerUtils.IsNotePassed(note.NextFlickOrSlide, now)) { return; } var nextSlideNote = note.NextFlickOrSlide; if (nextSlideNote == null) { // Actually, here is an example of invalid format. :) DrawTapNote(context, now, note); return; } else { var startX = NotesLayerUtils.GetEndXByNotePosition(context.ClientSize, note.FinishPosition); var endX = NotesLayerUtils.GetEndXByNotePosition(context.ClientSize, nextSlideNote.FinishPosition); y = NotesLayerUtils.GetAvatarYPosition(context.ClientSize); x = (float)((now - note.HitTiming) / (nextSlideNote.HitTiming - note.HitTiming)) * (endX - startX) + startX; r = Definitions.AvatarCircleRadius; } } else { return; } DrawNoteImage(context, note, x, y, r); }