2017-02-07 12:59:30 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-10-13 09:10:15 +08:00
|
|
|
|
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2016-10-13 09:10:15 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-08-03 07:32:38 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-10-10 15:34:01 +08:00
|
|
|
|
using osu.Framework.MathUtils;
|
|
|
|
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
2016-10-13 09:10:15 +08:00
|
|
|
|
using OpenTK;
|
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
2016-10-13 09:10:15 +08:00
|
|
|
|
{
|
2017-10-10 15:34:01 +08:00
|
|
|
|
public class DrawableFruit : DrawableCatchHitObject<Fruit>
|
2016-10-13 09:10:15 +08:00
|
|
|
|
{
|
2017-10-10 15:34:01 +08:00
|
|
|
|
public DrawableFruit(Fruit h)
|
2017-08-08 11:46:37 +08:00
|
|
|
|
: base(h)
|
2016-10-13 09:10:15 +08:00
|
|
|
|
{
|
2017-10-11 17:18:06 +08:00
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
2017-10-12 21:27:22 +08:00
|
|
|
|
Size = new Vector2(Pulp.PULP_SIZE * 2.2f, Pulp.PULP_SIZE * 2.8f);
|
2017-09-15 19:55:04 +08:00
|
|
|
|
AccentColour = HitObject.ComboColour;
|
|
|
|
|
Masking = false;
|
2017-10-10 15:34:01 +08:00
|
|
|
|
|
|
|
|
|
Rotation = (float)(RNG.NextDouble() - 0.5f) * 40;
|
2016-10-13 09:10:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-12 18:44:16 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
2017-08-02 18:37:20 +08:00
|
|
|
|
private void load()
|
|
|
|
|
{
|
|
|
|
|
Children = new Framework.Graphics.Drawable[]
|
|
|
|
|
{
|
2017-08-08 11:46:01 +08:00
|
|
|
|
//todo: share this more
|
|
|
|
|
new BufferedContainer
|
2017-08-02 18:37:20 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-08-08 11:46:01 +08:00
|
|
|
|
CacheDrawnFrameBuffer = true,
|
|
|
|
|
Children = new Framework.Graphics.Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Pulp
|
|
|
|
|
{
|
|
|
|
|
RelativePositionAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
2017-09-15 19:55:04 +08:00
|
|
|
|
AccentColour = AccentColour,
|
2017-08-08 11:46:01 +08:00
|
|
|
|
Scale = new Vector2(0.6f),
|
|
|
|
|
},
|
|
|
|
|
new Pulp
|
|
|
|
|
{
|
|
|
|
|
RelativePositionAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
2017-09-15 19:55:04 +08:00
|
|
|
|
AccentColour = AccentColour,
|
2017-08-08 11:46:01 +08:00
|
|
|
|
Y = -0.08f
|
|
|
|
|
},
|
|
|
|
|
new Pulp
|
|
|
|
|
{
|
|
|
|
|
RelativePositionAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.CentreRight,
|
|
|
|
|
Origin = Anchor.CentreRight,
|
2017-09-15 19:55:04 +08:00
|
|
|
|
AccentColour = AccentColour,
|
2017-08-08 11:46:01 +08:00
|
|
|
|
Y = -0.08f
|
|
|
|
|
},
|
|
|
|
|
new Pulp
|
|
|
|
|
{
|
|
|
|
|
RelativePositionAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
|
Origin = Anchor.BottomCentre,
|
2017-09-15 19:55:04 +08:00
|
|
|
|
AccentColour = AccentColour,
|
2017-08-08 11:46:01 +08:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-08-02 18:37:20 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
2016-10-13 09:10:15 +08:00
|
|
|
|
}
|
|
|
|
|
}
|