mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 21:07:18 +09:00
Make symbol pieces relative sized.
This commit is contained in:
parent
09c0e18a04
commit
74e9449a75
@ -11,17 +11,26 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The symbol used for centre hit pieces.
|
/// The symbol used for centre hit pieces.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CentreHitSymbolPiece : CircularContainer
|
public class CentreHitSymbolPiece : Container
|
||||||
{
|
{
|
||||||
public CentreHitSymbolPiece()
|
public CentreHitSymbolPiece()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Size = new Vector2(CirclePiece.SYMBOL_INNER_SIZE);
|
RelativeSizeAxes = Axes.Both;
|
||||||
Masking = true;
|
Size = new Vector2(CirclePiece.SYMBOL_SIZE);
|
||||||
|
Padding = new MarginPadding(CirclePiece.SYMBOL_BORDER);
|
||||||
|
|
||||||
Children = new[] { new Box { RelativeSizeAxes = Axes.Both } };
|
Children = new[]
|
||||||
|
{
|
||||||
|
new CircularContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
|
Children = new[] { new Box { RelativeSizeAxes = Axes.Both } }
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class CirclePiece : TaikoPiece
|
public class CirclePiece : TaikoPiece
|
||||||
{
|
{
|
||||||
public const float SYMBOL_SIZE = 36;
|
public const float SYMBOL_SIZE = 0.35f;
|
||||||
public const float SYMBOL_BORDER = 8;
|
public const float SYMBOL_BORDER = 8;
|
||||||
public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER;
|
|
||||||
private const double pre_beat_transition_time = 80;
|
private const double pre_beat_transition_time = 80;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// 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;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
||||||
@ -9,18 +12,34 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The symbol used for swell pieces.
|
/// The symbol used for swell pieces.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SwellSymbolPiece : TextAwesome
|
public class SwellSymbolPiece : Container
|
||||||
{
|
{
|
||||||
|
private readonly TextAwesome symbol;
|
||||||
|
|
||||||
public SwellSymbolPiece()
|
public SwellSymbolPiece()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = 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;
|
Children = new[]
|
||||||
UseFullGlyphHeight = true;
|
{
|
||||||
Shadow = false;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user