mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 17:57:38 +08:00
53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
// Copyright (c) 2007-2017 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.Sprites;
|
|
using osu.Framework.Graphics.Transforms;
|
|
using OpenTK;
|
|
using OpenTK.Graphics;
|
|
|
|
namespace osu.Game.Graphics.UserInterface
|
|
{
|
|
public class OsuPasswordTextBox : OsuTextBox
|
|
{
|
|
protected override Drawable GetDrawableCharacter(char c) => new PasswordMaskChar(CalculatedTextSize);
|
|
|
|
public class PasswordMaskChar : Container
|
|
{
|
|
private CircularContainer circle;
|
|
|
|
public PasswordMaskChar(float size)
|
|
{
|
|
Size = new Vector2(size / 2, size);
|
|
Children = new[]
|
|
{
|
|
circle = new CircularContainer
|
|
{
|
|
Anchor = Anchor.Centre,
|
|
Alpha = 0,
|
|
RelativeSizeAxes = Axes.Both,
|
|
Size = new Vector2(0.8f, 0),
|
|
Children = new[]
|
|
{
|
|
new Box
|
|
{
|
|
Colour = Color4.White,
|
|
RelativeSizeAxes = Axes.Both,
|
|
}
|
|
},
|
|
}
|
|
};
|
|
}
|
|
|
|
protected override void LoadComplete()
|
|
{
|
|
base.LoadComplete();
|
|
circle.FadeIn(500, EasingTypes.OutQuint);
|
|
circle.ResizeTo(new Vector2(0.8f), 500, EasingTypes.OutQuint);
|
|
}
|
|
}
|
|
}
|
|
}
|