From e67379b6de2619d16caf236b0ab4929264e5b001 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 8 Aug 2017 10:35:56 +0900 Subject: [PATCH] Use ScrollingHitRenderer --- .../Objects/Drawable/DrawableFruit.cs | 19 ++++++------------- .../UI/CatchHitRenderer.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 17 ++++++++++++++--- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index aa92f36d23..a2cf0ec279 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -15,7 +15,7 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.Objects.Drawable { - internal class DrawableFruit : DrawableHitObject + internal class DrawableFruit : DrawableScrollingHitObject { private class Pulp : Circle, IHasAccentColour { @@ -37,11 +37,11 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { Origin = Anchor.Centre; Size = new Vector2(50); - RelativePositionAxes = Axes.Both; - Position = new Vector2(h.Position, -0.1f); - Rotation = (float)(RNG.NextDouble() - 0.5f) * 40; - Alpha = 0; + RelativePositionAxes = Axes.Both; + X = h.Position; + + Rotation = (float)(RNG.NextDouble() - 0.5f) * 40; } [BackgroundDependencyLoader] @@ -91,8 +91,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable Position = new Vector2(0, 0.6f), }, }; - - Alpha = 0; } protected override CatchJudgement CreateJudgement() => new CatchJudgement(); @@ -103,14 +101,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { using (BeginAbsoluteSequence(HitObject.StartTime - preempt)) { - // default state - this.MoveToY(-0.1f).FadeOut(); - // animation - this.FadeIn(200).MoveToY(1, preempt); + this.FadeIn(200); } - - Expire(true); } } } diff --git a/osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs b/osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs index cd6adfeea9..8f614cc4c3 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs @@ -14,7 +14,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.UI { - public class CatchHitRenderer : HitRenderer + public class CatchHitRenderer : ScrollingHitRenderer { public CatchHitRenderer(WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(beatmap, isForCurrentRuleset) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 03aabc5632..3aed94daad 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -6,20 +6,31 @@ using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.UI; using OpenTK; using osu.Game.Rulesets.Catch.Judgements; +using osu.Framework.Graphics.Containers; namespace osu.Game.Rulesets.Catch.UI { - public class CatchPlayfield : Playfield + public class CatchPlayfield : ScrollingPlayfield { + protected override Container Content => content; + private readonly Container content; + public CatchPlayfield() + : base(Axes.Y) { Size = new Vector2(1); Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; - Children = new Drawable[] + InternalChildren = new Drawable[] { + content = new Container + { + Scale = new Vector2(1, -1), + RelativeSizeAxes = Axes.Both, + Origin = Anchor.BottomLeft + }, new CatcherArea { RelativeSizeAxes = Axes.Both, @@ -30,4 +41,4 @@ namespace osu.Game.Rulesets.Catch.UI }; } } -} \ No newline at end of file +}