1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-25 23:43:20 +08:00
osu-lazer/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.

62 lines
2.0 KiB
C#
Raw Normal View History

2020-04-21 18:00:34 +08: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.
2022-06-17 15:37:17 +08:00
#nullable disable
2020-04-21 18:00:34 +08:00
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 18:00:34 +08:00
using osu.Game.Skinning;
using osuTK;
2020-12-07 11:30:25 +08:00
namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
2020-04-21 18:00:34 +08:00
{
public class TaikoLegacyHitTarget : CompositeDrawable
2020-04-21 18:00:34 +08:00
{
private Container content;
2020-04-21 18:00:34 +08:00
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
{
RelativeSizeAxes = Axes.Both;
InternalChild = content = new Container
2020-04-21 18:00:34 +08:00
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
2020-04-21 18:00:34 +08: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 18:00:34 +08: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 18:00:34 +08:00
}
}