1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 11:52:55 +08:00

Better looking follow points.

This commit is contained in:
Damnae 2017-02-12 08:19:52 +01:00
parent d7be9539d1
commit de2791e179

View File

@ -2,36 +2,47 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK; using OpenTK;
using osu.Framework.Allocation; using OpenTK.Graphics;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics;
namespace osu.Game.Modes.Osu.Objects.Drawables.Connections namespace osu.Game.Modes.Osu.Objects.Drawables.Connections
{ {
public class FollowPoint : Container public class FollowPoint : Container
{ {
private Sprite followPoint;
public double StartTime; public double StartTime;
public double EndTime; public double EndTime;
public Vector2 EndPosition; public Vector2 EndPosition;
const float width = 8;
public FollowPoint() public FollowPoint()
{ {
Origin = Anchor.Centre; Origin = Anchor.Centre;
Alpha = 0; Alpha = 0;
Masking = true;
AutoSizeAxes = Axes.Both;
CornerRadius = width / 2;
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Glow,
Colour = Color4.White.Opacity(0.2f),
Radius = 4,
};
Children = new Drawable[] Children = new Drawable[]
{ {
followPoint = new Sprite new Box
{ {
Size = new Vector2(12f), Size = new Vector2(width),
Origin = Anchor.Centre,
BlendingMode = BlendingMode.Additive, BlendingMode = BlendingMode.Additive,
Alpha = 0.5f Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Alpha = 0.5f,
}, },
}; };
} }
@ -52,11 +63,5 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Connections
Delay(DrawableOsuHitObject.TIME_FADEIN); Delay(DrawableOsuHitObject.TIME_FADEIN);
Expire(true); Expire(true);
} }
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
followPoint.Texture = textures.Get(@"Play/osu/ring-glow");
}
} }
} }