Class CanvasState
- Namespace
- SimulationFramework.Drawing
- Assembly
- SimulationFramework.dll
Provides access to state-specific data of an ICanvas.
public abstract class CanvasState
- Inheritance
-
CanvasState
- Inherited Members
Properties
Antialias
If the canvas should render using antialiasing.
public bool Antialias { get; }
Property Value
ClipRegion
The clip region of the canvas, or null if clipping is disabled.
public Rectangle? ClipRegion { get; }
Property Value
DrawMode
Gets or sets the drawing mode of the canvas.
The state for each value of DrawMode is stored independently. Setting this property will use the previous state for that DrawMode value.
public DrawMode DrawMode { get; }
Property Value
FillColor
public Color FillColor { get; }
Property Value
FillTexture
public ITexture? FillTexture { get; }
Property Value
FillTextureTileModeX
The tiling mode of the fill texture on the X axis. This property's default value is Clamp.
public TileMode FillTextureTileModeX { get; }
Property Value
FillTextureTileModeY
The tiling mode of the fill texture on the Y axis. This property's default value is Clamp.
public TileMode FillTextureTileModeY { get; }
Property Value
FillTextureTransform
The transform applied to the fill texture. This property's default value is Identity.
public Matrix3x2 FillTextureTransform { get; }
Property Value
Font
The current font.
public IFont? Font { get; }
Property Value
FontSize
The font size when drawing text.
public float FontSize { get; }
Property Value
FontStyle
The font style whe drawing text.
public FontStyle FontStyle { get; }
Property Value
Gradient
public Gradient? Gradient { get; }
Property Value
StrokeColor
public Color StrokeColor { get; }
Property Value
StrokeWidth
The stroke width of the canvas. This value only has an effect on drawing when drawing lines or when DrawMode is Stroke.
public float StrokeWidth { get; }
Property Value
Transform
The canvas's current transformation matrix.
public Matrix3x2 Transform { get; }
Property Value
Methods
Initialize(CanvasState?)
Initializes this CanvasState instance, optionally based off another instance.
protected virtual void Initialize(CanvasState? other)
Parameters
other
CanvasStateThe CanvasState instance which this state should be initialized to match, or null if this state should be initialized to its default values.
Reapply()
Reapplies the state's settings.
protected void Reapply()
UpdateAntialias(bool)
When overridden in dervied classes, updates whether canvas state has antialiasing enabled.
protected virtual void UpdateAntialias(bool antialias)
Parameters
antialias
bool
UpdateClipRegion(Rectangle?)
When overridden in dervied classes, updates the canvas state's clip region.
protected virtual void UpdateClipRegion(Rectangle? clipRegion)
Parameters
clipRegion
Rectangle?
UpdateDrawMode(DrawMode)
When overridden in dervied classes, updates the canvas state's draw mode.
protected virtual void UpdateDrawMode(DrawMode drawMode)
Parameters
drawMode
DrawMode
UpdateFillColor(Color)
When overridden in dervied classes, updates the canvas state's fill color.
protected virtual void UpdateFillColor(Color fillColor)
Parameters
fillColor
Color
UpdateFillTexture(ITexture?, Matrix3x2, TileMode, TileMode)
When overridden in dervied classes, updates the canvas state's fill texture and any respective settings.
protected virtual void UpdateFillTexture(ITexture? texture, Matrix3x2 transform, TileMode tileModeX, TileMode tileModeY)
Parameters
UpdateFont(IFont?)
When overridden in dervied classes, updates the canvas state's font.
protected virtual void UpdateFont(IFont? font)
Parameters
font
IFont
UpdateFontSize(float)
Updates the canvas state's current font size.
protected virtual void UpdateFontSize(float fontSize)
Parameters
fontSize
float
UpdateFontStyle(FontStyle)
When overridden in dervied classes, updates the canvas state's font style.
protected virtual void UpdateFontStyle(FontStyle style)
Parameters
style
FontStyle
UpdateGradient(Gradient?)
When overridden in dervied classes, updates the canvas state's gradient.
protected virtual void UpdateGradient(Gradient? gradient)
Parameters
gradient
Gradient
UpdateStrokeColor(Color)
When overridden in dervied classes, updates the canvas state's stroke color.
protected virtual void UpdateStrokeColor(Color strokeColor)
Parameters
strokeColor
Color
UpdateStrokeWidth(float)
When overridden in dervied classes, updates the canvas state's stroke width.
protected virtual void UpdateStrokeWidth(float strokeWidth)
Parameters
strokeWidth
float
UpdateTransform(Matrix3x2)
When overridden in dervied classes, updates the canvas state's transform.
protected virtual void UpdateTransform(Matrix3x2 transform)
Parameters
transform
Matrix3x2