1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 15:53:19 +08:00

Simplify + fix up circle pieces.

This commit is contained in:
smoogipooo 2017-08-03 13:53:12 +09:30
parent b2d69dfa02
commit 786bad3d71
7 changed files with 29 additions and 27 deletions

View File

@ -17,15 +17,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
{ {
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
Size = new Vector2(CirclePiece.SYMBOL_INNER_SIZE); Size = new Vector2(CirclePiece.SYMBOL_INNER_SIZE);
Masking = true; Masking = true;
Children = new[]
{ Children = new[] { new Box { RelativeSizeAxes = Axes.Both } };
new Box
{
RelativeSizeAxes = Axes.Both
}
};
} }
} }
} }

View File

@ -9,6 +9,7 @@ using osu.Game.Graphics.Backgrounds;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
using OpenTK;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
{ {
@ -21,7 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
/// </summary> /// </summary>
public class CirclePiece : TaikoPiece public class CirclePiece : TaikoPiece
{ {
public const float SYMBOL_SIZE = TaikoHitObject.DEFAULT_CIRCLE_DIAMETER * 0.45f; public const float SYMBOL_SIZE = 36;
public const float SYMBOL_BORDER = 8; public const float SYMBOL_BORDER = 8;
public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER; 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;
@ -120,30 +121,20 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
}, },
content = new Container content = new Container
{ {
RelativeSizeAxes = Axes.Both,
Name = "Content", Name = "Content",
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
} }
}); });
if (isStrong) if (isStrong)
{ {
Size *= TaikoHitObject.STRONG_CIRCLE_DIAMETER_SCALE; content.Scale = new Vector2(TaikoHitObject.STRONG_SCALE);
content.Width = 1 / TaikoHitObject.STRONG_SCALE;
//default for symbols etc.
Content.Scale *= TaikoHitObject.STRONG_CIRCLE_DIAMETER_SCALE;
} }
} }
protected override void Update()
{
base.Update();
//we want to allow for width of content to remain mapped to the area inside us, regardless of the scale applied above.
Content.Width = 1 / Content.Scale.X;
}
private const float edge_alpha_kiai = 0.5f; private const float edge_alpha_kiai = 0.5f;
private void resetEdgeEffects() private void resetEdgeEffects()

View File

@ -18,8 +18,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
/// </summary> /// </summary>
public float Length; public float Length;
public ElongatedCirclePiece(bool isStrong = false) : base(isStrong) public ElongatedCirclePiece(bool isStrong = false)
: base(isStrong)
{ {
RelativeSizeAxes = Axes.Y;
} }
protected override void Update() protected override void Update()

View File

@ -18,7 +18,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
{ {
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
Size = new Vector2(CirclePiece.SYMBOL_SIZE); Size = new Vector2(CirclePiece.SYMBOL_SIZE);
BorderThickness = CirclePiece.SYMBOL_BORDER; BorderThickness = CirclePiece.SYMBOL_BORDER;
BorderColour = Color4.White; BorderColour = Color4.White;
Masking = true; Masking = true;

View File

@ -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
@ -15,9 +18,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
{ {
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
UseFullGlyphHeight = true;
TextSize = CirclePiece.SYMBOL_INNER_SIZE; TextSize = CirclePiece.SYMBOL_INNER_SIZE;
Icon = FontAwesome.fa_asterisk; Icon = FontAwesome.fa_asterisk;
UseFullGlyphHeight = true;
Shadow = false; Shadow = false;
} }
} }

View File

@ -5,6 +5,9 @@ using osu.Game.Graphics;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Framework.Graphics;
using System;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
{ {
@ -35,8 +38,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
public TaikoPiece() public TaikoPiece()
{ {
//just a default RelativeSizeAxes = Axes.Both;
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER);
} }
} }
} }

View File

@ -15,12 +15,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
/// Any tick that is not the first for a drumroll is not filled, but is instead displayed /// Any tick that is not the first for a drumroll is not filled, but is instead displayed
/// as a hollow circle. This is what controls the border width of that circle. /// as a hollow circle. This is what controls the border width of that circle.
/// </summary> /// </summary>
private const float tick_border_width = TaikoHitObject.DEFAULT_CIRCLE_DIAMETER / 16; private const float tick_border_width = 5;
/// <summary> /// <summary>
/// The size of a tick. /// The size of a tick.
/// </summary> /// </summary>
private const float tick_size = TaikoHitObject.DEFAULT_CIRCLE_DIAMETER / 6; private const float tick_size = 14;
private bool filled; private bool filled;
public bool Filled public bool Filled
@ -37,6 +37,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
public TickPiece() public TickPiece()
{ {
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
RelativeSizeAxes = Axes.None;
Size = new Vector2(tick_size); Size = new Vector2(tick_size);
Add(new CircularContainer Add(new CircularContainer