2017-05-09 19:55:20 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
2017-05-04 17:02:43 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-05-09 19:55:20 +08:00
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
using osu.Framework.Graphics;
|
2017-05-04 17:02:43 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
|
|
|
|
|
{
|
2017-05-09 19:55:20 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents length-wise portion of a hold note.
|
|
|
|
|
/// </summary>
|
2017-05-04 17:02:43 +08:00
|
|
|
|
internal class BodyPiece : Container, IHasAccentColour
|
|
|
|
|
{
|
2017-05-11 13:11:52 +08:00
|
|
|
|
private readonly Box box;
|
2017-05-04 17:02:43 +08:00
|
|
|
|
|
|
|
|
|
public BodyPiece()
|
|
|
|
|
{
|
2017-05-09 19:33:59 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
2017-05-04 17:02:43 +08:00
|
|
|
|
Masking = true;
|
|
|
|
|
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
box = new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Alpha = 0.3f
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Color4 accentColour;
|
|
|
|
|
public Color4 AccentColour
|
|
|
|
|
{
|
|
|
|
|
get { return accentColour; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (accentColour == value)
|
|
|
|
|
return;
|
|
|
|
|
accentColour = value;
|
|
|
|
|
|
|
|
|
|
box.Colour = accentColour;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|