Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    FastTextRenderer Class

    Namespace: Stride.Graphics
    Assembly: Stride.Graphics.dll

    Renders text with a fixed size font.

    System.Object → DisposeBase → ComponentBase → FastTextRenderer
    Derived from FastTextRenderer:

    public class FastTextRenderer : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
    Name Description
    Constructors
    FastTextRenderer(GraphicsContext, Int32)
    Properties
    DebugSpriteFont

    Sets or gets the sprite font texture to use when drawing the text. The sprite font must have fixed size of DebugSpriteWidth and DebugSpriteHeight and each glyph should have uniform size of GlyphWidth and GlyphHeight

    DebugSpriteHeight

    Height of font Texture DebugSpriteFont.

    DebugSpriteWidth

    Width of font Texture DebugSpriteFont.

    GlyphHeight

    Height of a single glyph of font DebugSpriteFont.

    GlyphWidth

    Width of a single glyph of font DebugSpriteFont.

    MatrixTransform

    A general matrix transformation for the text. Should include view and projection if needed.

    TextColor

    Sets or gets the color to use when drawing the text.

    Methods
    Begin(GraphicsContext)

    Begins text rendering (swaps and maps the vertex buffer to write to).

    Destroy()
    DrawString(GraphicsContext, String, Int32, Int32)

    Adds a string to be drawn once End() is called.

    End(GraphicsContext)

    Begins text rendering (swaps and maps the vertex buffer to write to).

    | Improve this Doc View Source

    Constructors


    FastTextRenderer(GraphicsContext, Int32)

    public FastTextRenderer(GraphicsContext graphicsContext, int maxCharacterCount = 7000)
    Parameters
    Type Name Description
    GraphicsContext graphicsContext
    System.Int32 maxCharacterCount
    | Improve this Doc View Source

    Properties


    DebugSpriteFont

    Sets or gets the sprite font texture to use when drawing the text. The sprite font must have fixed size of DebugSpriteWidth and DebugSpriteHeight and each glyph should have uniform size of GlyphWidth and GlyphHeight

    public Texture DebugSpriteFont { get; set; }
    Property Value
    Type Description
    Texture

    DebugSpriteHeight

    Height of font Texture DebugSpriteFont.

    public int DebugSpriteHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    DebugSpriteWidth

    Width of font Texture DebugSpriteFont.

    public int DebugSpriteWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    GlyphHeight

    Height of a single glyph of font DebugSpriteFont.

    public int GlyphHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    GlyphWidth

    Width of a single glyph of font DebugSpriteFont.

    public int GlyphWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    MatrixTransform

    A general matrix transformation for the text. Should include view and projection if needed.

    public Matrix MatrixTransform { get; set; }
    Property Value
    Type Description
    Matrix

    TextColor

    Sets or gets the color to use when drawing the text.

    public Color4 TextColor { get; set; }
    Property Value
    Type Description
    Color4
    | Improve this Doc View Source

    Methods


    Begin(GraphicsContext)

    Begins text rendering (swaps and maps the vertex buffer to write to).

    public void Begin(GraphicsContext graphicsContext)
    Parameters
    Type Name Description
    GraphicsContext graphicsContext

    The current GraphicsContext.


    Destroy()

    protected override void Destroy()
    Overrides
    ComponentBase.Destroy()

    DrawString(GraphicsContext, String, Int32, Int32)

    Adds a string to be drawn once End() is called.

    public void DrawString(GraphicsContext graphicsContext, string text, int x, int y)
    Parameters
    Type Name Description
    GraphicsContext graphicsContext

    The current GraphicsContext.

    System.String text

    The text to draw. Should not be modified until call to End.

    System.Int32 x

    Position of the text on the X axis (in viewport space).

    System.Int32 y

    Position of the text on the Y axis (in viewport space).


    End(GraphicsContext)

    Begins text rendering (swaps and maps the vertex buffer to write to).

    public void End(GraphicsContext graphicsContext)
    Parameters
    Type Name Description
    GraphicsContext graphicsContext

    The current GraphicsContext.


    Inherited Members

    ComponentBase.Tags
    ComponentBase.Name
    ComponentBase.ICollectorHolder.Collector
    ComponentBase.OnNameChanged()
    ComponentBase.ToString()
    DisposeBase.Dispose()
    DisposeBase.IsDisposed
    DisposeBase.IReferencable.ReferenceCount
    DisposeBase.IReferencable.AddReference()
    DisposeBase.IReferencable.Release()
    DisposeBase.OnAddReference()
    DisposeBase.OnReleaseReference()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation