1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 09:02:58 +08:00

Change anchors in line with new ScrollingPlayfield implementation

(cherry picked from commit 079827d)
This commit is contained in:
Dean Herbert 2018-01-11 13:41:50 +09:00
parent 3b929ffd21
commit 9e3091bfe9
2 changed files with 5 additions and 11 deletions

View File

@ -4,7 +4,6 @@
using System.Linq; using System.Linq;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using OpenTK;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Catch.Objects.Drawable namespace osu.Game.Rulesets.Catch.Objects.Drawable
@ -16,22 +15,17 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
public DrawableBananaShower(BananaShower s) public DrawableBananaShower(BananaShower s)
: base(s) : base(s)
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.X;
Height = (float)HitObject.Duration; Origin = Anchor.BottomLeft;
X = 0; X = 0;
Child = bananaContainer = new Container Child = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
{
RelativeSizeAxes = Axes.Both,
RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime),
RelativeChildSize = new Vector2(1, (float)HitObject.Duration)
};
foreach (var b in s.NestedHitObjects.Cast<BananaShower.Banana>()) foreach (var b in s.NestedHitObjects.Cast<BananaShower.Banana>())
AddNested(new DrawableFruit(b)); AddNested(new DrawableFruit(b));
} }
protected override void AddNested(DrawableHitObject<CatchHitObject> h) protected override void AddNested(DrawableHitObject h)
{ {
((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false;
bananaContainer.Add(h); bananaContainer.Add(h);

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Catch.Tests
} }
}; };
beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 10000, NewCombo = true }); beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 500, NewCombo = true });
return beatmap; return beatmap;
} }