-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #641 from LumpBloom7/SDF-touch
Draw touch note triangles with SDF shader
- Loading branch information
Showing
13 changed files
with
545 additions
and
142 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
osu.Game.Rulesets.Sentakki.Tests/Graphics/TestSceneTouchTriangle.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,42 @@ | ||
using System.Linq; | ||
using NUnit.Framework; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Shapes; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Beatmaps.ControlPoints; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Touches; | ||
using osu.Game.Tests.Visual; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Graphics | ||
{ | ||
[TestFixture] | ||
public partial class TestSceneTouchTriangle : OsuGridTestScene | ||
{ | ||
protected override Ruleset CreateRuleset() => new SentakkiRuleset(); | ||
public TestSceneTouchTriangle() : base(1, 2) | ||
{ | ||
Cell(0).Add(new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
Colour = Color4.White | ||
}); | ||
Cell(1).Add(new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
Colour = Color4.White | ||
}); | ||
Cell(0).Add(new TouchPiece()); | ||
Cell(1).Add(new TouchPiece() | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
}); | ||
} | ||
} | ||
} |
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
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
14 changes: 8 additions & 6 deletions
14
osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldBody.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
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
86 changes: 86 additions & 0 deletions
86
...me.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldCompletedCentrePiece.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,86 @@ | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Effects; | ||
using osu.Framework.Graphics.UserInterface; | ||
using osu.Game.Graphics; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.TouchHolds | ||
{ | ||
public partial class TouchHoldCompletedCentre : CompositeDrawable | ||
{ | ||
private readonly OsuColour colours = new OsuColour(); | ||
|
||
public TouchHoldCompletedCentre() | ||
{ | ||
Origin = Anchor.Centre; | ||
Anchor = Anchor.Centre; | ||
Size = new Vector2(80); | ||
Masking = true; | ||
CornerRadius = 20; | ||
Rotation = 45; | ||
Alpha = 0; | ||
EdgeEffect = new EdgeEffectParameters | ||
{ | ||
Type = EdgeEffectType.Shadow, | ||
Colour = Color4.Black, | ||
Radius = 10f, | ||
}; | ||
InternalChildren = new Drawable[] | ||
{ | ||
new Container | ||
{ | ||
Origin = Anchor.Centre, | ||
Anchor = Anchor.Centre, | ||
RelativeSizeAxes = Axes.Both, | ||
Size = new Vector2(2), | ||
Rotation = -45f, | ||
Children = new Drawable[] | ||
{ | ||
new CircularProgress | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
InnerRadius = 1, | ||
Size = Vector2.One, | ||
RelativeSizeAxes = Axes.Both, | ||
Progress = 1, | ||
Colour = colours.Blue | ||
}, | ||
new CircularProgress | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
InnerRadius = 1, | ||
Size = Vector2.One, | ||
RelativeSizeAxes = Axes.Both, | ||
Progress = 0.75 , | ||
Colour = colours.Green | ||
}, | ||
new CircularProgress | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
InnerRadius = 1, | ||
Size = Vector2.One, | ||
RelativeSizeAxes = Axes.Both, | ||
Progress = 0.5 , | ||
Colour = colours.Yellow, | ||
}, | ||
new CircularProgress | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
InnerRadius = 1, | ||
Size = Vector2.One, | ||
RelativeSizeAxes = Axes.Both, | ||
Progress = 0.25 , | ||
Colour = colours.Red, | ||
}, | ||
} | ||
}, | ||
}; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
osu.Game.Rulesets.Sentakki/Objects/Drawables/Pieces/TouchHolds/TouchHoldTrianglePiece.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,26 @@ | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Touches; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.TouchHolds | ||
{ | ||
public partial class TouchHoldPiece : CompositeDrawable | ||
{ | ||
public TouchHoldPiece() | ||
{ | ||
Anchor = Anchor.Centre; | ||
Origin = Anchor.Centre; | ||
|
||
AddInternal(new DrawableTouchTriangle | ||
{ | ||
Anchor = Anchor.TopCentre, | ||
Origin = Anchor.TopCentre, | ||
Size = new Vector2(73, 45f), | ||
Thickness = 8f, | ||
ShadowRadius = 0f, | ||
FillTriangle = true, | ||
}); | ||
} | ||
} | ||
} |
Oops, something went wrong.