Make OsuTextBox use OsuSpriteText.

This commit is contained in:
Dean Herbert
2017-02-08 11:19:58 +09:00
parent e720bed9e5
commit 5a89ba1040
2 changed files with 15 additions and 3 deletions

View File

@ -8,6 +8,7 @@ using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using OpenTK.Graphics;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface
{
@ -17,10 +18,12 @@ namespace osu.Game.Graphics.UserInterface
protected override Color4 BackgroundFocused => OsuColour.Gray(0.3f).Opacity(0.8f);
protected override Color4 BackgroundCommit => BorderColour;
protected override float LeftRightPadding => 10;
public OsuTextBox()
{
Height = 40;
TextContainer.Height = OsuSpriteText.FONT_SIZE / Height;
TextContainer.Height = 0.5f;
CornerRadius = 5;
}
@ -43,6 +46,8 @@ namespace osu.Game.Graphics.UserInterface
base.OnFocusLost(state);
}
protected override SpriteText GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString() };
}
public class OsuPasswordTextBox : OsuTextBox