Table of Contents

Interface IGraphicsProvider

Namespace
SimulationFramework.Drawing
Assembly
SimulationFramework.dll

Interface which provides graphics functionality as a component of a simulation.

public interface IGraphicsProvider : ISimulationComponent, IDisposable
Inherited Members

Properties

DefaultFont

Returns an instance of the default font.

IFont DefaultFont { get; }

Property Value

IFont

Methods

GetFrameCanvas()

Gets the canvas for the current frame.

ICanvas GetFrameCanvas()

Returns

ICanvas

The canvas which draws to the current frame. This object should never be saved, as it may be different every frame.

TryCreateTexture(int, int, ReadOnlySpan<Color>, TextureOptions, out ITexture)

Creates a new bitmap with the provided data.

bool TryCreateTexture(int width, int height, ReadOnlySpan<Color> pixels, TextureOptions options, out ITexture texture)

Parameters

width int
height int
pixels ReadOnlySpan<Color>
options TextureOptions
texture ITexture

Returns

bool

TryLoadFont(ReadOnlySpan<byte>, out IFont?)

Loads a font from a font file.

bool TryLoadFont(ReadOnlySpan<byte> encodedData, out IFont? font)

Parameters

encodedData ReadOnlySpan<byte>
font IFont

Returns

bool

TryLoadSystemFont(string, out IFont?)

Attempts to load a system font by name.

bool TryLoadSystemFont(string name, out IFont? font)

Parameters

name string
font IFont

Returns

bool

TryLoadTexture(ReadOnlySpan<byte>, TextureOptions, out ITexture?)

Loads a bitmap from a image file.

bool TryLoadTexture(ReadOnlySpan<byte> encodedData, TextureOptions options, out ITexture? texture)

Parameters

encodedData ReadOnlySpan<byte>
options TextureOptions
texture ITexture

Returns

bool