mirror of
https://github.com/ppy/osu.git
synced 2025-02-11 07:12:59 +08:00
Expose font size and add big button test
This commit is contained in:
parent
cd197a9380
commit
52a8f3848d
@ -16,8 +16,9 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[Cached]
|
[Cached]
|
||||||
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green);
|
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green);
|
||||||
|
|
||||||
[Test]
|
[TestCase(false)]
|
||||||
public void TestShearedButton()
|
[TestCase(true)]
|
||||||
|
public void TestShearedButton(bool bigButton)
|
||||||
{
|
{
|
||||||
ShearedButton button = null;
|
ShearedButton button = null;
|
||||||
bool actionFired = false;
|
bool actionFired = false;
|
||||||
@ -26,6 +27,23 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
actionFired = false;
|
actionFired = false;
|
||||||
|
|
||||||
|
if (bigButton)
|
||||||
|
{
|
||||||
|
Child = button = new ShearedButton(400)
|
||||||
|
{
|
||||||
|
LighterColour = Colour4.FromHex("#FFFFFF"),
|
||||||
|
DarkerColour = Colour4.FromHex("#FFCC22"),
|
||||||
|
TextColour = Colour4.Black,
|
||||||
|
TextSize = 36,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Text = "Let's GO!",
|
||||||
|
Height = 80,
|
||||||
|
Action = () => actionFired = true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Child = button = new ShearedButton(200)
|
Child = button = new ShearedButton(200)
|
||||||
{
|
{
|
||||||
LighterColour = Colour4.FromHex("#FF86DD"),
|
LighterColour = Colour4.FromHex("#FF86DD"),
|
||||||
@ -37,6 +55,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
Height = 80,
|
Height = 80,
|
||||||
Action = () => actionFired = true,
|
Action = () => actionFired = true,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("set disabled", () => button.Enabled.Value = false);
|
AddStep("set disabled", () => button.Enabled.Value = false);
|
||||||
|
@ -23,6 +23,12 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float TextSize
|
||||||
|
{
|
||||||
|
get => text.Font.Size;
|
||||||
|
set => text.Font = OsuFont.TorusAlternate.With(size: value);
|
||||||
|
}
|
||||||
|
|
||||||
public Colour4 DarkerColour
|
public Colour4 DarkerColour
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
|
Loading…
Reference in New Issue
Block a user