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();
|
CatcherTrailSprite sprite = trailPool.Get();
|
||||||
|
|
||||||
sprite.Texture = catcher.CurrentTexture;
|
sprite.AnimationState = catcher.CurrentState;
|
||||||
sprite.Anchor = catcher.Anchor;
|
sprite.Origin = catcher.Origin;
|
||||||
sprite.Scale = catcher.Scale;
|
sprite.Scale = catcher.Scale;
|
||||||
sprite.Blending = BlendingParameters.Additive;
|
sprite.Blending = BlendingParameters.Additive;
|
||||||
sprite.RelativePositionAxes = catcher.RelativePositionAxes;
|
sprite.RelativePositionAxes = catcher.RelativePositionAxes;
|
||||||
|
@ -3,32 +3,24 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Pooling;
|
using osu.Framework.Graphics.Pooling;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Graphics.Textures;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
public class CatcherTrailSprite : PoolableDrawable
|
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()
|
public CatcherTrailSprite()
|
||||||
{
|
{
|
||||||
InternalChild = sprite = new Sprite
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
};
|
|
||||||
|
|
||||||
Size = new Vector2(CatcherArea.CATCHER_SIZE);
|
Size = new Vector2(CatcherArea.CATCHER_SIZE);
|
||||||
|
Origin = Anchor.TopCentre;
|
||||||
// Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
|
InternalChild = body = new SkinnableCatcher();
|
||||||
OriginPosition = new Vector2(0.5f, 0.06f) * CatcherArea.CATCHER_SIZE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void FreeAfterUse()
|
protected override void FreeAfterUse()
|
||||||
|
Loading…
Reference in New Issue
Block a user