Skip to content

Commit

Permalink
Merge pull request #6307 from EVAST9919/sprite-text-shader
Browse files Browse the repository at this point in the history
Make shader setter in `SpriteText` protected
  • Loading branch information
bdach authored Jun 4, 2024
2 parents 980b4cd + efb3250 commit 8211a94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions osu.Framework/Graphics/Sprites/Sprite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ private void load(ShaderManager shaders)
TextureShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE);
}

/// <summary>
/// The shader which should be used for rendering this sprite.
/// </summary>
/// <remarks>
/// This is automatically populated, but may be overridden if required for special cases.
/// If overriding, set in a <see cref="BackgroundDependencyLoaderAttribute"/> method or later.</remarks>
public IShader TextureShader { get; protected set; }

private RectangleF textureRectangle = new RectangleF(0, 0, 1, 1);
Expand Down
8 changes: 7 additions & 1 deletion osu.Framework/Graphics/Sprites/SpriteText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ public partial class SpriteText : Drawable, IHasLineBaseHeight, ITexturedShaderD

private ILocalisedBindableString localisedText;

public IShader TextureShader { get; private set; }
/// <summary>
/// The shader which should be used for rendering this sprite text.
/// </summary>
/// <remarks>
/// This is automatically populated, but may be overridden if required for special cases.
/// If overriding, set in a <see cref="BackgroundDependencyLoaderAttribute"/> method or later.</remarks>
public IShader TextureShader { get; protected set; }

public SpriteText()
{
Expand Down

0 comments on commit 8211a94

Please sign in to comment.