Class UIRenderContext
- Namespace
- Forma
- Assembly
- Forma.dll
SpriteBatch-backed drawing surface used by controls. Applications can subclass controls to draw custom content.
public sealed class UIRenderContext : IDisposable
- Inheritance
-
UIRenderContext
- Implements
- Inherited Members
Properties
CompositorDiagnostics
Deduplicated runtime composition-limit reports retained for this device context.
public IReadOnlyList<string> CompositorDiagnostics { get; }
Property Value
Drawing
Backend-neutral vector drawing operations for foundational visuals.
public DrawingContext Drawing { get; }
Property Value
GraphicsDevice
public GraphicsDevice GraphicsDevice { get; }
Property Value
- GraphicsDevice
SpriteBatch
public SpriteBatch SpriteBatch { get; }
Property Value
- SpriteBatch
Theme
public Theme Theme { get; }
Property Value
Methods
Begin()
public void Begin()
Border(Rectangle, Color, int)
public void Border(Rectangle rectangle, Color color, int width = 1)
Parameters
rectangleRectanglecolorColorwidthint
Dispose()
public void Dispose()
DrawScalableImage(ScalableImageSource, Rectangle, Color, ImageSamplingMode)
Draws a scalable image through the exact-size device cache.
public bool DrawScalableImage(ScalableImageSource source, Rectangle destination, Color color, ImageSamplingMode samplingMode = ImageSamplingMode.Linear)
Parameters
sourceScalableImageSourcedestinationRectanglecolorColorsamplingModeImageSamplingMode
Returns
End()
public void End()
Fill(Rectangle, Color)
public void Fill(Rectangle rectangle, Color color)
Parameters
rectangleRectanglecolorColor
FillRounded(Rectangle, Color, int)
Fills a deterministic pixel-rounded rectangle without requiring an external texture asset.
public void FillRounded(Rectangle rectangle, Color color, int radius)
Parameters
rectangleRectanglecolorColorradiusint
Icon(ThemeIcon, Rectangle, Color)
Draws a theme-owned atlas region into a pixel-rounded logical rectangle.
public void Icon(ThemeIcon icon, Rectangle destination, Color color)
Parameters
iconThemeIcondestinationRectanglecolorColor
Icon(ThemeIcon, Vector2, Color)
Draws a theme-owned atlas region at its stable logical size.
public void Icon(ThemeIcon icon, Vector2 position, Color color)
Parameters
iconThemeIconpositionVector2colorColor
PopClip()
Restores the parent clip previously installed with PushClip(Rectangle).
public void PopClip()
PushClip(Rectangle)
Clips subsequent drawing to the intersection of this rectangle and all active parent clips.
public void PushClip(Rectangle rectangle)
Parameters
rectangleRectangle
Text(TextLayout, Vector2, Color)
Draws an immutable layout without repeating measurement or line breaking.
public void Text(TextLayout layout, Vector2 position, Color color)
Parameters
layoutTextLayoutpositionVector2colorColor
Text(UIFont, string, Vector2, Color)
public void Text(UIFont font, string text, Vector2 position, Color color)
Parameters
Text(SpriteFont, string, Vector2, Color)
public void Text(SpriteFont font, string text, Vector2 position, Color color)
Parameters
fontSpriteFonttextstringpositionVector2colorColor
Text(SpriteFont, string, Vector2, Color, float)
Draws SpriteFont text at a deterministic uniform scale for controls with a font-size override.
public void Text(SpriteFont font, string text, Vector2 position, Color color, float scale)
Parameters
TexturedFan(Texture2D, Vector2, Vector2, IReadOnlyList<Vector2>, IReadOnlyList<Vector2>, Color)
Draws a texture-clipped triangle fan while preserving the active UI clip and batch state.
public void TexturedFan(Texture2D texture, Vector2 center, Vector2 centerUv, IReadOnlyList<Vector2> boundary, IReadOnlyList<Vector2> uvs, Color color)
Parameters
textureTexture2DcenterVector2centerUvVector2boundaryIReadOnlyList<Vector2>uvsIReadOnlyList<Vector2>colorColor