mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
76 lines
2.7 KiB
C#
76 lines
2.7 KiB
C#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Framework.MathUtils;
|
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
|
using OpenTK;
|
|
|
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|
{
|
|
public class DrawableFruit : DrawableCatchHitObject<Fruit>
|
|
{
|
|
private const float pulp_size = 20;
|
|
|
|
public DrawableFruit(Fruit h)
|
|
: base(h)
|
|
{
|
|
Size = new Vector2(pulp_size * 2.2f, pulp_size * 2.8f);
|
|
AccentColour = HitObject.ComboColour;
|
|
Masking = false;
|
|
|
|
Rotation = (float)(RNG.NextDouble() - 0.5f) * 40;
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load()
|
|
{
|
|
Children = new Framework.Graphics.Drawable[]
|
|
{
|
|
//todo: share this more
|
|
new BufferedContainer
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
CacheDrawnFrameBuffer = true,
|
|
Children = new Framework.Graphics.Drawable[]
|
|
{
|
|
new Pulp
|
|
{
|
|
RelativePositionAxes = Axes.Both,
|
|
Anchor = Anchor.TopCentre,
|
|
Origin = Anchor.TopCentre,
|
|
AccentColour = AccentColour,
|
|
Scale = new Vector2(0.6f),
|
|
},
|
|
new Pulp
|
|
{
|
|
RelativePositionAxes = Axes.Both,
|
|
Anchor = Anchor.CentreLeft,
|
|
Origin = Anchor.CentreLeft,
|
|
AccentColour = AccentColour,
|
|
Y = -0.08f
|
|
},
|
|
new Pulp
|
|
{
|
|
RelativePositionAxes = Axes.Both,
|
|
Anchor = Anchor.CentreRight,
|
|
Origin = Anchor.CentreRight,
|
|
AccentColour = AccentColour,
|
|
Y = -0.08f
|
|
},
|
|
new Pulp
|
|
{
|
|
RelativePositionAxes = Axes.Both,
|
|
Anchor = Anchor.BottomCentre,
|
|
Origin = Anchor.BottomCentre,
|
|
AccentColour = AccentColour,
|
|
},
|
|
}
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|