mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:43:20 +08:00
Improve mascot scaling
This commit is contained in:
parent
e5821ff2b2
commit
942cc48e99
@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
InternalChild = textureAnimation = createTextureAnimation(state).With(animation =>
|
InternalChild = textureAnimation = createTextureAnimation(state).With(animation =>
|
||||||
{
|
{
|
||||||
animation.Origin = animation.Anchor = Anchor.BottomLeft;
|
animation.Origin = animation.Anchor = Anchor.BottomLeft;
|
||||||
animation.Scale = new Vector2(0.6f);
|
animation.Scale = new Vector2(0.51f); // close enough to stable
|
||||||
});
|
});
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Layout;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
@ -15,6 +16,7 @@ using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
|||||||
using osu.Game.Rulesets.Taiko.Judgements;
|
using osu.Game.Rulesets.Taiko.Judgements;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.UI
|
namespace osu.Game.Rulesets.Taiko.UI
|
||||||
{
|
{
|
||||||
@ -32,6 +34,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
private JudgementContainer<DrawableTaikoJudgement> judgementContainer;
|
private JudgementContainer<DrawableTaikoJudgement> judgementContainer;
|
||||||
private ScrollingHitObjectContainer drumRollHitContainer;
|
private ScrollingHitObjectContainer drumRollHitContainer;
|
||||||
internal Drawable HitTarget;
|
internal Drawable HitTarget;
|
||||||
|
private SkinnableDrawable mascot;
|
||||||
|
|
||||||
private ProxyContainer topLevelHitContainer;
|
private ProxyContainer topLevelHitContainer;
|
||||||
private ProxyContainer barlineContainer;
|
private ProxyContainer barlineContainer;
|
||||||
@ -40,9 +43,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
private Container hitTargetOffsetContent;
|
private Container hitTargetOffsetContent;
|
||||||
|
|
||||||
|
private readonly LayoutValue<float> playfieldScaleLayout = new LayoutValue<float>(Invalidation.DrawSize);
|
||||||
|
private float playfieldScale => playfieldScaleLayout.IsValid ? playfieldScaleLayout.Value : playfieldScaleLayout.Value = DrawHeight / DEFAULT_HEIGHT;
|
||||||
|
|
||||||
public TaikoPlayfield(ControlPointInfo controlPoints)
|
public TaikoPlayfield(ControlPointInfo controlPoints)
|
||||||
{
|
{
|
||||||
this.controlPoints = controlPoints;
|
this.controlPoints = controlPoints;
|
||||||
|
|
||||||
|
AddLayout(playfieldScaleLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -125,14 +133,13 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.TaikoDon), _ => Empty())
|
mascot = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.TaikoDon), _ => Empty())
|
||||||
{
|
{
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.TopLeft,
|
Anchor = Anchor.TopLeft,
|
||||||
RelativePositionAxes = Axes.None,
|
RelativePositionAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
X = 15,
|
Y = 0.2f
|
||||||
Y = 45
|
|
||||||
},
|
},
|
||||||
topLevelHitContainer = new ProxyContainer
|
topLevelHitContainer = new ProxyContainer
|
||||||
{
|
{
|
||||||
@ -151,6 +158,8 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
// This is basically allowing for correct alignment as relative pieces move around them.
|
// This is basically allowing for correct alignment as relative pieces move around them.
|
||||||
rightArea.Padding = new MarginPadding { Left = leftArea.DrawWidth };
|
rightArea.Padding = new MarginPadding { Left = leftArea.DrawWidth };
|
||||||
hitTargetOffsetContent.Padding = new MarginPadding { Left = HitTarget.DrawWidth / 2 };
|
hitTargetOffsetContent.Padding = new MarginPadding { Left = HitTarget.DrawWidth / 2 };
|
||||||
|
|
||||||
|
mascot.Scale = new Vector2(playfieldScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Add(DrawableHitObject h)
|
public override void Add(DrawableHitObject h)
|
||||||
|
Loading…
Reference in New Issue
Block a user