1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:07:25 +08:00
osu-lazer/osu.Game/Graphics/Cursor/CursorContainer.cs
2016-08-26 17:27:49 +09:00

37 lines
943 B
C#

//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Drawables;
using osu.Framework.Input;
using OpenTK;
namespace osu.Game.Graphics.Cursor
{
class CursorContainer : LargeContainer
{
private Cursor cursor;
public CursorContainer()
{
Add(cursor = new Cursor());
}
protected override bool OnMouseMove(InputState state)
{
cursor.Position = GetLocalPosition(state.Mouse.Position);
return base.OnMouseMove(state);
}
class Cursor : Box
{
public Cursor()
{
Size = new Vector2(5, 5);
Origin = Anchor.Centre;
}
}
}
}