diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs index 3074be9df0..5409ed2f9f 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -2,6 +2,7 @@ //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; +using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -41,12 +42,13 @@ namespace osu.Game.Graphics.Cursor class OsuCursor : Container { + private Container cursorContainer; private BindableDouble cursorScale; - private Sprite sprite; + public OsuCursor() { Origin = Anchor.Centre; - AutoSizeAxes = Axes.Both; + Size = new Vector2(42); } [BackgroundDependencyLoader] @@ -56,18 +58,64 @@ namespace osu.Game.Graphics.Cursor Children = new Drawable[] { - sprite = new Sprite + cursorContainer = new CircularContainer { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, Scale = new Vector2((float)cursorScale), - Texture = textures.Get(@"Cursor/cursor") - } + Masking = true, + BorderThickness = Size.X / 6, + BorderColour = Color4.White, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.01f, + }, + new CircularContainer + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Masking = true, + BorderThickness = Size.X / 3, + BorderColour = Color4.White.Opacity(0.5f), + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.01f, + }, + }, + }, + new CircularContainer + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Scale = new Vector2(0.1f), + Masking = true, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + }, + }, + }, + } + }, }; cursorScale.ValueChanged += scaleChanged; } private void scaleChanged(object sender, EventArgs e) { - sprite.Scale = new Vector2((float)cursorScale); + cursorContainer.Scale = new Vector2((float)cursorScale); } } } diff --git a/osu.Game/Graphics/UserInterface/Nub.cs b/osu.Game/Graphics/UserInterface/Nub.cs index cd59c13d12..9eca8582cb 100644 --- a/osu.Game/Graphics/UserInterface/Nub.cs +++ b/osu.Game/Graphics/UserInterface/Nub.cs @@ -39,7 +39,7 @@ namespace osu.Game.Graphics.UserInterface fill = new Box { RelativeSizeAxes = Axes.Both, - Alpha = 0.01f, //todo: remove once we figure why containers aren't drawing at all times + Alpha = 0.01f, }, }; }