2020-03-11 13:28:13 +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.
|
|
|
|
|
2020-12-07 17:12:55 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Pooling;
|
2020-03-11 13:28:13 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Graphics.Textures;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.UI
|
|
|
|
{
|
2020-12-07 17:12:55 +08:00
|
|
|
public class CatcherTrailSprite : PoolableDrawable
|
2020-03-11 13:28:13 +08:00
|
|
|
{
|
2020-12-07 17:12:55 +08:00
|
|
|
public Texture Texture
|
2020-03-11 13:28:13 +08:00
|
|
|
{
|
2020-12-07 17:12:55 +08:00
|
|
|
set => sprite.Texture = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
private readonly Sprite sprite;
|
|
|
|
|
|
|
|
public CatcherTrailSprite()
|
|
|
|
{
|
|
|
|
InternalChild = sprite = new Sprite
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both
|
|
|
|
};
|
2020-03-11 13:28:13 +08:00
|
|
|
|
|
|
|
Size = new Vector2(CatcherArea.CATCHER_SIZE);
|
|
|
|
|
|
|
|
// Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
|
|
|
|
OriginPosition = new Vector2(0.5f, 0.06f) * CatcherArea.CATCHER_SIZE;
|
|
|
|
}
|
2020-12-08 16:31:00 +08:00
|
|
|
|
|
|
|
protected override void FreeAfterUse()
|
|
|
|
{
|
|
|
|
ClearTransforms();
|
|
|
|
base.FreeAfterUse();
|
|
|
|
}
|
2020-03-11 13:28:13 +08:00
|
|
|
}
|
|
|
|
}
|