Rewrite circle pieces to use custom graphics again.

Also using FontAwesome for now to enforce the same size, because otherwise you have to mess around with sprites + the custom graphics. This will all be changed when sprites are fixed to maintain aspect ratios and when glow/border use relative axes.
This commit is contained in:
smoogipooo
2017-03-24 20:08:40 +09:00
parent 405c6f9691
commit fdd17c1575
3 changed files with 66 additions and 28 deletions

View File

@ -15,9 +15,9 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
/// </summary>
private const float accent_scale = 1.5f;
public AccentedCirclePiece(string symbolName)
: base(symbolName)
public AccentedCirclePiece()
{
SymbolContainer.Scale = new Vector2(accent_scale);
}
public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * accent_scale);

View File

@ -7,8 +7,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Backgrounds;
using OpenTK.Graphics;
using osu.Framework.Graphics.Textures;
using osu.Framework.Allocation;
using System;
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
@ -63,18 +61,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
set { throw new InvalidOperationException($"{nameof(CirclePiece)} must always use CentreLeft origin."); }
}
protected override Container<Framework.Graphics.Drawable> Content => SymbolContainer;
protected readonly Container SymbolContainer;
private readonly Container innerLayer;
private readonly Container innerCircleContainer;
private readonly Box innerBackground;
private readonly Triangles triangles;
private readonly Sprite symbol;
private readonly string symbolName;
public CirclePiece(string symbolName)
public CirclePiece()
{
this.symbolName = symbolName;
Height = TaikoHitObject.CIRCLE_RADIUS * 2;
// The "inner layer" is the body of the CirclePiece that overshoots it by Height/2 px on both sides
@ -130,24 +126,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
}
}
},
symbol = new Sprite
SymbolContainer = new Container
{
Name = "Symbol",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both
}
}
});
}
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
if (!string.IsNullOrEmpty(symbolName))
symbol.Texture = textures.Get($@"Play/Taiko/{symbolName}-symbol");
}
protected override void Update()
{
// Add the overshoot to compensate for corner radius