1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 15:23:14 +08:00

Rework border + fillmodes + size in TaikoPlayfield.

This commit is contained in:
smoogipooo 2017-08-03 13:35:07 +09:30
parent 17cad76054
commit 324fd456a7
3 changed files with 31 additions and 11 deletions

View File

@ -59,7 +59,7 @@ namespace osu.Desktop.VisualTests.Tests
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = TaikoPlayfield.DEFAULT_PLAYFIELD_HEIGHT, Height = TaikoPlayfield.DEFAULT_HEIGHT,
Clock = new FramedClock(rateAdjustClock), Clock = new FramedClock(rateAdjustClock),
Children = new[] Children = new[]
{ {
@ -100,7 +100,7 @@ namespace osu.Desktop.VisualTests.Tests
playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, rng.Next(25, 400)), 500); playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, rng.Next(25, 400)), 500);
break; break;
case 6: case 6:
playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, TaikoPlayfield.DEFAULT_PLAYFIELD_HEIGHT), 500); playfieldContainer.Delay(delay).ResizeTo(new Vector2(TaikoPlayfield.DEFAULT_HEIGHT), 500);
break; break;
} }
} }

View File

@ -85,7 +85,7 @@ namespace osu.Game.Rulesets.Taiko.UI
protected override Vector2 GetPlayfieldAspectAdjust() protected override Vector2 GetPlayfieldAspectAdjust()
{ {
const float default_relative_height = TaikoPlayfield.DEFAULT_PLAYFIELD_HEIGHT / 768; const float default_relative_height = TaikoPlayfield.DEFAULT_HEIGHT / 768;
const float default_aspect = 16f / 9f; const float default_aspect = 16f / 9f;
float aspectAdjust = MathHelper.Clamp(DrawWidth / DrawHeight, 0.4f, 4) / default_aspect; float aspectAdjust = MathHelper.Clamp(DrawWidth / DrawHeight, 0.4f, 4) / default_aspect;

View File

@ -22,14 +22,14 @@ namespace osu.Game.Rulesets.Taiko.UI
public class TaikoPlayfield : Playfield<TaikoHitObject, TaikoJudgement> public class TaikoPlayfield : Playfield<TaikoHitObject, TaikoJudgement>
{ {
/// <summary> /// <summary>
/// The default play field height. /// Default height of a <see cref="TaikoPlayfield"/> when inside a <see cref="TaikoHitRenderer"/>.
/// </summary> /// </summary>
public const float DEFAULT_PLAYFIELD_HEIGHT = 178f; public const float DEFAULT_HEIGHT = 178;
/// <summary> /// <summary>
/// The offset from <see cref="left_area_size"/> which the center of the hit target lies at. /// The offset from <see cref="left_area_size"/> which the center of the hit target lies at.
/// </summary> /// </summary>
public const float HIT_TARGET_OFFSET = TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER / 2f + 40; public const float HIT_TARGET_OFFSET = 100;
/// <summary> /// <summary>
/// The size of the left area of the playfield. This area contains the input drum. /// The size of the left area of the playfield. This area contains the input drum.
@ -60,7 +60,6 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
Name = "Transparent playfield background", Name = "Transparent playfield background",
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
BorderThickness = 2,
Masking = true, Masking = true,
EdgeEffect = new EdgeEffectParameters EdgeEffect = new EdgeEffectParameters
{ {
@ -81,7 +80,7 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
Name = "Right area", Name = "Right area",
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Margin = new MarginPadding { Left = left_area_size }, Padding = new MarginPadding { Left = left_area_size },
Children = new Drawable[] Children = new Drawable[]
{ {
new Container new Container
@ -94,7 +93,8 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
hitExplosionContainer = new Container<HitExplosion> hitExplosionContainer = new Container<HitExplosion>
{ {
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
BlendingMode = BlendingMode.Additive, BlendingMode = BlendingMode.Additive,
}, },
barLineContainer = new Container<DrawableBarLine> barLineContainer = new Container<DrawableBarLine>
@ -105,6 +105,8 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit
}, },
hitObjectContainer = new Container hitObjectContainer = new Container
{ {
@ -115,7 +117,8 @@ namespace osu.Game.Rulesets.Taiko.UI
kiaiExplosionContainer = new Container<KiaiHitExplosion> kiaiExplosionContainer = new Container<KiaiHitExplosion>
{ {
Name = "Kiai hit explosions", Name = "Kiai hit explosions",
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
Margin = new MarginPadding { Left = HIT_TARGET_OFFSET }, Margin = new MarginPadding { Left = HIT_TARGET_OFFSET },
BlendingMode = BlendingMode.Additive BlendingMode = BlendingMode.Additive
}, },
@ -133,7 +136,6 @@ namespace osu.Game.Rulesets.Taiko.UI
Name = "Left overlay", Name = "Left overlay",
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Size = new Vector2(left_area_size, 1), Size = new Vector2(left_area_size, 1),
BorderThickness = 1,
Children = new Drawable[] Children = new Drawable[]
{ {
overlayBackground = new Box overlayBackground = new Box
@ -156,6 +158,24 @@ namespace osu.Game.Rulesets.Taiko.UI
}, },
} }
}, },
new Container
{
Name = "Border",
RelativeSizeAxes = Axes.Both,
Masking = true,
MaskingSmoothness = 0,
BorderThickness = 2,
AlwaysPresent = true,
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
}
}
},
topLevelHitContainer = new Container topLevelHitContainer = new Container
{ {
Name = "Top level hit objects", Name = "Top level hit objects",