mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Use common skinnable catcher in catcher trails
This commit is contained in:
parent
ca061c4b93
commit
9b6ab4360e
@ -120,8 +120,8 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
{
|
||||
CatcherTrailSprite sprite = trailPool.Get();
|
||||
|
||||
sprite.Texture = catcher.CurrentTexture;
|
||||
sprite.Anchor = catcher.Anchor;
|
||||
sprite.AnimationState = catcher.CurrentState;
|
||||
sprite.Origin = catcher.Origin;
|
||||
sprite.Scale = catcher.Scale;
|
||||
sprite.Blending = BlendingParameters.Additive;
|
||||
sprite.RelativePositionAxes = catcher.RelativePositionAxes;
|
||||
|
@ -3,32 +3,24 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Pooling;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.UI
|
||||
{
|
||||
public class CatcherTrailSprite : PoolableDrawable
|
||||
{
|
||||
public Texture Texture
|
||||
public CatcherAnimationState AnimationState
|
||||
{
|
||||
set => sprite.Texture = value;
|
||||
set => body.AnimationState.Value = value;
|
||||
}
|
||||
|
||||
private readonly Sprite sprite;
|
||||
private readonly SkinnableCatcher body;
|
||||
|
||||
public CatcherTrailSprite()
|
||||
{
|
||||
InternalChild = sprite = new Sprite
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
};
|
||||
|
||||
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;
|
||||
Origin = Anchor.TopCentre;
|
||||
InternalChild = body = new SkinnableCatcher();
|
||||
}
|
||||
|
||||
protected override void FreeAfterUse()
|
||||
|
Loading…
Reference in New Issue
Block a user