mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Make symbol pieces relative sized.
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
||||
@ -9,18 +12,34 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
||||
/// <summary>
|
||||
/// The symbol used for swell pieces.
|
||||
/// </summary>
|
||||
public class SwellSymbolPiece : TextAwesome
|
||||
public class SwellSymbolPiece : Container
|
||||
{
|
||||
private readonly TextAwesome symbol;
|
||||
|
||||
public SwellSymbolPiece()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
TextSize = CirclePiece.SYMBOL_INNER_SIZE;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Size = new Vector2(CirclePiece.SYMBOL_SIZE);
|
||||
Padding = new MarginPadding(CirclePiece.SYMBOL_BORDER);
|
||||
|
||||
Icon = FontAwesome.fa_asterisk;
|
||||
UseFullGlyphHeight = true;
|
||||
Shadow = false;
|
||||
Children = new[]
|
||||
{
|
||||
symbol = new TextAwesome
|
||||
{
|
||||
Icon = FontAwesome.fa_asterisk,
|
||||
UseFullGlyphHeight = true,
|
||||
Shadow = false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
symbol.TextSize = Math.Min(ChildSize.X, ChildSize.Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user