-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the test case to test the outline.
- Loading branch information
1 parent
6a2f6bc
commit 11710ae
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
osu.Framework.Font.Tests/Visual/Shaders/TestSceneDefaultKaraokeLyricShader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) karaoke.dev <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using NUnit.Framework; | ||
using osu.Framework.Extensions; | ||
using osu.Framework.Extensions.Color4Extensions; | ||
using osu.Framework.Graphics.Shaders; | ||
|
||
namespace osu.Framework.Font.Tests.Visual.Shaders | ||
{ | ||
public class TestSceneDefaultKaraokeLyricShader : TestSceneInternalShader | ||
{ | ||
[TestCase("#FFFF00", 10, "#FFFF00")] | ||
[TestCase("#FF0000", 20, "#FFFFFF")] | ||
public void TestOutline(string colour, int radius, string outlineColour) | ||
{ | ||
AddStep("Apply shader", () => | ||
{ | ||
ShaderContainer.Shaders = new[] | ||
{ | ||
GetShaderByType<DefaultKaraokeLyricShader>().With(s => | ||
{ | ||
s.Colour = Color4Extensions.FromHex(colour); | ||
s.Radius = radius; | ||
s.OutlineColour = Color4Extensions.FromHex(outlineColour); | ||
}) | ||
}; | ||
}); | ||
} | ||
} | ||
} |