protected override DrawableManiaHitObject CreateHitObject() { var note = new HoldNote { Duration = 1000 }; note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); return(new DrawableHoldNote(note)); }
private void createHoldNote() { for (int i = 0; i < columns.Count; i++) { var obj = new HoldNote { Column = i, StartTime = Time.Current + 2000, Duration = 500 }; obj.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); columns[i].Add(new DrawableHoldNote(obj, columns[i].Action)); } }
public TestSceneHoldNoteSelectionBlueprint() : base(4) { for (int i = 0; i < 4; i++) { var holdNote = new HoldNote { Column = i, StartTime = i * 100, Duration = 500 }; holdNote.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); var drawableHitObject = new DrawableHoldNote(holdNote); Playfield.Add(drawableHitObject); AddBlueprint(new HoldNoteSelectionBlueprint(holdNote), drawableHitObject); } }
private Drawable createHoldNoteDisplay(ScrollingDirection direction, int identifier, out DrawableHoldNote hitObject) { var note = new HoldNote { StartTime = 0, Duration = 5000 }; note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); return(new ScrollingTestContainer(direction) { AutoSizeAxes = Axes.Both, Child = new NoteContainer(direction, $"hold note {identifier}, scrolling {direction.ToString().ToLowerInvariant()}") { Child = hitObject = new DrawableHoldNote(note) { RelativeSizeAxes = Axes.Both, AccentColour = { Value = Color4.OrangeRed }, } } }); }
public TestSceneHoldNoteSelectionBlueprint() { var holdNote = new HoldNote { Column = 0, Duration = 1000 }; holdNote.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); base.Content.Child = content = new ScrollingTestContainer(ScrollingDirection.Down) { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Y, Width = 50, Child = drawableObject = new DrawableHoldNote(holdNote) { Height = 300, AccentColour = OsuColour.Gray(0.3f) } }; }
private Drawable createHoldNoteDisplay(ScrollingDirection direction) { var note = new HoldNote { StartTime = 999999999, Duration = 1000 }; note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); return(new ScrollingTestContainer(direction) { AutoSizeAxes = Axes.Both, Child = new NoteContainer(direction, $"hold note, scrolling {direction.ToString().ToLower()}") { Child = new DrawableHoldNote(note, ManiaAction.Key1) { RelativeSizeAxes = Axes.Both, AccentColour = Color4.OrangeRed, } } }); }
public void TestHoldNoteHeadVisibility() { DrawableHoldNote note = null; AddStep("Add hold note", () => { var h = new HoldNote { StartTime = 0, Duration = 1000 }; h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); column.Add(note = new DrawableHoldNote(h)); }); AddStep("Hold key", () => { clock.CurrentTime = 0; note.OnPressed(new KeyBindingPressEvent <ManiaAction>(GetContainingInputManager().CurrentState, ManiaAction.Key1)); }); AddStep("progress time", () => clock.CurrentTime = 500); AddAssert("head is visible", () => note.Head.Alpha == 1); }
private void createPlayfieldWithNotes(bool inverted = false) { Clear(); var rateAdjustClock = new StopwatchClock(true) { Rate = 1 }; var inputManager = new ManiaInputManager(maniaRuleset, 4) { RelativeSizeAxes = Axes.Both }; Add(inputManager); ManiaPlayfield playfield; var stages = new List <StageDefinition> { new StageDefinition { Columns = 4 }, }; inputManager.Add(playfield = new ManiaPlayfield(stages) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Clock = new FramedClock(rateAdjustClock) }); playfield.Inverted.Value = inverted; for (double t = start_time; t <= start_time + duration; t += 100) { var note1 = new Note { StartTime = t, Column = 0 }; var note2 = new Note { StartTime = t, Column = 3 }; note1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); note2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); playfield.Add(new DrawableNote(note1, ManiaAction.Key1)); playfield.Add(new DrawableNote(note2, ManiaAction.Key4)); } var holdNote1 = new HoldNote { StartTime = start_time, Duration = duration, Column = 1 }; var holdNote2 = new HoldNote { StartTime = start_time, Duration = duration, Column = 2 }; holdNote1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); holdNote2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); playfield.Add(new DrawableHoldNote(holdNote1, ManiaAction.Key2)); playfield.Add(new DrawableHoldNote(holdNote2, ManiaAction.Key3)); }
public TestCaseManiaHitObjects() { Note note1 = new Note(); Note note2 = new Note(); HoldNote holdNote = new HoldNote { StartTime = 1000 }; note1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); note2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); holdNote.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); Add(new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, Spacing = new Vector2(10, 0), // Imagine that the containers containing the drawable notes are the "columns" Children = new Drawable[] { new Container { Name = "Normal note column", Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, Width = 50, Children = new[] { new Container { Name = "Timing section", RelativeSizeAxes = Axes.Both, RelativeChildSize = new Vector2(1, 10000), Children = new[] { new DrawableNote(note1, ManiaAction.Key1) { Y = 5000, LifetimeStart = double.MinValue, LifetimeEnd = double.MaxValue, AccentColour = Color4.Red }, new DrawableNote(note2, ManiaAction.Key1) { Y = 6000, LifetimeStart = double.MinValue, LifetimeEnd = double.MaxValue, AccentColour = Color4.Red } } } } }, new Container { Name = "Hold note column", Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, Width = 50, Children = new[] { new Container { Name = "Timing section", RelativeSizeAxes = Axes.Both, RelativeChildSize = new Vector2(1, 10000), Children = new[] { new DrawableHoldNote(holdNote, ManiaAction.Key1) { Y = 5000, Height = 1000, LifetimeStart = double.MinValue, LifetimeEnd = double.MaxValue, AccentColour = Color4.Red, } } } } } } }); }