2021-06-14 10:41:51 +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.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2021-06-14 10:41:51 +00:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Rulesets.Catch.Skinning.Default;
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.UI
|
|
|
|
{
|
2021-06-16 05:01:12 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The visual representation of the <see cref="Catcher"/>.
|
|
|
|
/// It includes the body part of the catcher and the catcher plate.
|
|
|
|
/// </summary>
|
2021-06-14 10:41:51 +00:00
|
|
|
public class SkinnableCatcher : SkinnableDrawable
|
|
|
|
{
|
2021-06-16 07:17:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// This is used by skin elements to determine which texture of the catcher is used.
|
|
|
|
/// </summary>
|
2021-06-14 10:41:51 +00:00
|
|
|
[Cached]
|
|
|
|
public readonly Bindable<CatcherAnimationState> AnimationState = new Bindable<CatcherAnimationState>();
|
|
|
|
|
|
|
|
public SkinnableCatcher()
|
|
|
|
: base(new CatchSkinComponent(CatchSkinComponents.Catcher), _ => new DefaultCatcher())
|
|
|
|
{
|
|
|
|
Anchor = Anchor.TopCentre;
|
|
|
|
// Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
|
2021-07-21 07:43:24 +00:00
|
|
|
OriginPosition = new Vector2(0.5f, 0.06f) * Catcher.BASE_SIZE;
|
2021-06-14 10:41:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|