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
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
intheight
intpixels
ReadOnlySpan<Color>options
TextureOptionstexture
ITexture
Returns
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
TryLoadSystemFont(string, out IFont?)
Attempts to load a system font by name.
bool TryLoadSystemFont(string name, out IFont? font)
Parameters
Returns
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
TextureOptionstexture
ITexture