osu/osu.Game.Rulesets.Taiko/Skinning/Legacy/TaikoLegacyHitTarget.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
2.0 KiB
C#
Raw Normal View History

2020-04-21 10:00:34 +00:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Taiko.UI;
2020-04-21 10:00:34 +00:00
using osu.Game.Skinning;
using osuTK;
2020-12-07 03:30:25 +00:00
namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
2020-04-21 10:00:34 +00:00
{
public partial class TaikoLegacyHitTarget : CompositeDrawable
2020-04-21 10:00:34 +00:00
{
2022-11-02 08:07:19 +00:00
private Container content = null!;
2020-04-21 10:00:34 +00:00
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
{
RelativeSizeAxes = Axes.Both;
InternalChild = content = new Container
2020-04-21 10:00:34 +00:00
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
2020-04-21 10:00:34 +00:00
{
new Sprite
{
Texture = skin.GetTexture("approachcircle"),
Scale = new Vector2(0.83f),
Alpha = 0.47f, // eyeballed to match stable
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
new Sprite
{
Texture = skin.GetTexture("taikobigcircle"),
Scale = new Vector2(0.8f),
Alpha = 0.22f, // eyeballed to match stable
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
}
2020-04-21 10:00:34 +00:00
};
}
protected override void Update()
{
base.Update();
// Relying on RelativeSizeAxes.Both + FillMode.Fit doesn't work due to the precise pixel layout requirements.
// This is a bit ugly but makes the non-legacy implementations a lot cleaner to implement.
content.Scale = new Vector2(DrawHeight / TaikoPlayfield.DEFAULT_HEIGHT);
}
2020-04-21 10:00:34 +00:00
}
}