1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 03:57:25 +08:00
osu-lazer/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs

55 lines
1.8 KiB
C#
Raw Normal View History

//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2016-09-24 08:57:13 +08:00
using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK.Input;
2016-12-05 00:58:52 +08:00
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Configuration;
using OpenTK;
using OpenTK.Graphics;
2016-09-24 08:57:13 +08:00
namespace osu.Desktop.VisualTests.Tests
2016-09-24 08:57:13 +08:00
{
class TestCaseKeyCounter : TestCase
{
public override string Name => @"KeyCounter";
public override string Description => @"Tests key counter";
public override void Reset()
{
base.Reset();
2016-12-05 00:58:52 +08:00
KeyCounterCollection kc;
BindableInt bindable = new BindableInt { MinValue = 0, MaxValue = 1000, Default = 50 };
AddButton("Add Random", null);
Add(new SliderBar<int>
2016-09-24 08:57:13 +08:00
{
2016-12-05 00:58:52 +08:00
Origin = Anchor.TopLeft,
Anchor = Anchor.TopLeft,
Width = 150,
Height = 10,
SelectionColor = Color4.Orange,
Position = new Vector2(0, 50),
Bindable = bindable
});
Add(kc = new KeyCounterCollection
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
IsCounting = true,
Children = new KeyCounter[]
{
2016-12-05 00:58:52 +08:00
new KeyCounterKeyboard(@"Z", Key.Z),
new KeyCounterKeyboard(@"X", Key.X),
new KeyCounterMouse(@"M1", MouseButton.Left),
new KeyCounterMouse(@"M2", MouseButton.Right),
},
2016-12-05 00:58:52 +08:00
});
2016-09-24 08:57:13 +08:00
}
}
}