Canvas API Reference
Class: Canvas
namespace EvolveUI.Rendering
public unsafe class Canvas : IDisposable
HTML5-style Canvas API for 2D vector graphics rendering.
Constructor
public Canvas(UIAssetManager assetManager)
Creates a new Canvas instance.
| Parameter | Type | Description |
|---|---|---|
assetManager | UIAssetManager | The asset manager providing font library access |
State Management
Save
public void Save()
Saves the current drawing state (transform, colors, styles) onto a stack.
Restore
public void Restore()
Restores the most recently saved drawing state from the stack.
Reset
public void Reset()
Resets the entire canvas state to defaults.
Clear
public void Clear()
Clears all generated geometry data.
Fill Styles
SetFillColor
public void SetFillColor(byte r, byte g, byte b, byte a = 255)
public void SetFillColor(Color32 color)
public void SetFillColor(float r, float g, float b, float a = 1f)
public void SetFillColor(Color color)
Sets the fill color using various formats. All inputs are interpreted as sRGB and converted to linear internally.
| Parameter | Type | Description |
|---|---|---|
r, g, b, a | byte or float | Color components (0-255 or 0.0-1.0) |
color | Color32 or Color | Unity color value |
SetLinearGradient
public void SetLinearGradient(float sx, float sy, float ex, float ey, Color32 startColor, Color32 endColor)
public void SetLinearGradient(float sx, float sy, float ex, float ey, ColorStop[] colorStops)
Sets a linear gradient fill.
| Parameter | Type | Description |
|---|---|---|
sx, sy | float | Gradient start point |
ex, ey | float | Gradient end point |
startColor | Color32 | Color at start (t=0) |
endColor | Color32 | Color at end (t=1) |
colorStops | ColorStop[] | Array of color stops for multi-stop gradients |
SetRadialGradient
public void SetRadialGradient(float cx, float cy, float radius, Color32 innerColor, Color32 outerColor)
public void SetRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, Color32 innerColor, Color32 outerColor)
public void SetRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ColorStop[] colorStops)
Sets a radial gradient fill.
| Parameter | Type | Description |
|---|---|---|
cx, cy | float | Center point (simple form) |
radius | float | Gradient radius (simple form) |
x0, y0, r0 | float | Inner circle center and radius |
x1, y1, r1 | float | Outer circle center and radius |
innerColor | Color32 | Color at center/inner circle |
outerColor | Color32 | Color at edge/outer circle |
colorStops | ColorStop[] | Array of color stops |
SetConicGradient
public void SetConicGradient(float cx, float cy, float startAngle, Color32 startColor, Color32 endColor)
public void SetConicGradient(float cx, float cy, float startAngle, ColorStop[] colorStops)
Sets a conic (sweep) gradient fill.
| Parameter | Type | Description |
|---|---|---|
cx, cy | float | Center point |
startAngle | float | Start angle in radians |
startColor | Color32 | Color at start angle |
endColor | Color32 | Color at end (360 degrees) |
colorStops | ColorStop[] | Array of color stops |
SetFillGradient
public void SetFillGradient(CanvasGradient gradient)
Sets the fill style to use a gradient object.
| Parameter | Type | Description |
|---|---|---|
gradient | CanvasGradient | A pre-configured gradient object |
Stroke Styles
SetStrokeColor
public void SetStrokeColor(byte r, byte g, byte b, byte a = 255)
public void SetStrokeColor(Color32 color)
public void SetStrokeColor(Color color)
Sets the stroke color.
SetStrokeGradient
public void SetStrokeGradient(CanvasGradient gradient)
Sets the stroke style to use a gradient object.
SetStrokeLinearGradient
public void SetStrokeLinearGradient(float sx, float sy, float ex, float ey, Color32 startColor, Color32 endColor)
Sets a linear gradient stroke.
SetStrokeRadialGradient
public void SetStrokeRadialGradient(float cx, float cy, float radius, Color32 innerColor, Color32 outerColor)
Sets a radial gradient stroke.
SetStrokeConicGradient
public void SetStrokeConicGradient(float cx, float cy, float startAngle, Color32 startColor, Color32 endColor)
Sets a conic gradient stroke.
SetStrokeWidth
public void SetStrokeWidth(float width)
Sets the stroke width in pixels.
SetStrokeCapType
public void SetStrokeCapType(StrokeCapType capType)
Sets the line cap style.
SetStrokeJoinType
public void SetStrokeJoinType(StrokeJoinType joinType)
Sets the line join style.
SetStrokeMiterLimit
public void SetStrokeMiterLimit(float limit)
Sets the miter limit for line joins.
SetDashPattern
public void SetDashPattern(float[] dashes, float offset = 0f)
public void SetDashPattern(float dash0, float dash1, float dash2 = 0f, float dash3 = 0f)
Sets a dash pattern for strokes. Supports up to 4 dash values.
| Parameter | Type | Description |
|---|---|---|
dashes | float[] | Array of dash lengths (max 4) |
offset | float | Starting offset into pattern |
dash0-dash3 | float | Individual dash values (0 = unused) |
Pattern/Texture Styles
SetPatternTexture
public void SetPatternTexture(TextureId textureId, int atlasX = 0, int atlasY = 0, int atlasWidth = 0, int atlasHeight = 0)
Sets a pattern texture for fills and strokes.
| Parameter | Type | Description |
|---|---|---|
textureId | TextureId | Texture identifier |
atlasX, atlasY | int | Sub-region position (0 = full texture) |
atlasWidth, atlasHeight | int | Sub-region size (0 = full texture) |
SetPatternMode
public void SetPatternMode(PatternSpace space, PatternSizing sizing, PatternRepeat repeat)
Sets the pattern coordinate space, sizing mode, and repeat behavior.
| Parameter | Type | Description |
|---|---|---|
space | PatternSpace | Bounds or World |
sizing | PatternSizing | Stretch, Contain, Cover, or Tile |
repeat | PatternRepeat | NoRepeat, Repeat, RepeatX, or RepeatY |
SetPatternTileSize
public void SetPatternTileSize(float width, float height)
Sets the tile size for PatternSizing.Tile mode.
SetPatternPosition
public void SetPatternPosition(float x, float y)
Sets the pattern origin/anchor offset.
SetPatternTransform
public void SetPatternTransform(EVGTransform transform)
Sets an additional transform for the pattern.
ClearPattern
public void ClearPattern()
Clears the current pattern, reverting to solid color/gradient fills.
Global Alpha
SetGlobalAlpha
public void SetGlobalAlpha(float alpha)
Sets the global alpha multiplier (0.0 to 1.0) for all drawing operations.
Transforms
Translate
public void Translate(float x, float y)
Translates the coordinate system.
Rotate
public void Rotate(float angle)
Rotates the coordinate system by angle (in radians, clockwise).
Scale
public void Scale(float x, float y)
Scales the coordinate system.
SkewX
public void SkewX(float angle)
Skews the X axis by angle (in radians).
SkewY
public void SkewY(float angle)
Skews the Y axis by angle (in radians).
Transform
public void Transform(float a, float b, float c, float d, float e, float f)
Applies a custom transformation matrix.
Matrix format:
| a c e |
| b d f |
| 0 0 1 |
SetTransform
public void SetTransform(float a, float b, float c, float d, float e, float f)
Replaces the current transformation matrix.
ResetTransform
public void ResetTransform()
Resets the transformation matrix to identity.
GetTransform
public EVGTransform GetTransform()
Gets the current transformation matrix.
Path Construction
BeginPath
public void BeginPath()
Begins a new path. Any existing path is cleared.
ClosePath
public void ClosePath()
Closes the current path by drawing a line to the start point.
MoveTo
public void MoveTo(float x, float y)
Moves the current point to (x, y) without drawing.
LineTo
public void LineTo(float x, float y)
Draws a line from the current point to (x, y).
QuadraticCurveTo
public void QuadraticCurveTo(float cx, float cy, float x, float y)
Draws a quadratic Bezier curve.
| Parameter | Type | Description |
|---|---|---|
cx, cy | float | Control point |
x, y | float | End point |
BezierCurveTo
public void BezierCurveTo(float c1x, float c1y, float c2x, float c2y, float x, float y)
Draws a cubic Bezier curve.
| Parameter | Type | Description |
|---|---|---|
c1x, c1y | float | First control point |
c2x, c2y | float | Second control point |
x, y | float | End point |
Arc
public void Arc(float cx, float cy, float r, float a0, float a1, int dir = 1)
Draws an arc.
| Parameter | Type | Description |
|---|---|---|
cx, cy | float | Center point |
r | float | Radius |
a0 | float | Start angle (radians) |
a1 | float | End angle (radians) |
dir | int | Direction: 1 = counter-clockwise, 2 = clockwise |
ArcTo
public void ArcTo(float x1, float y1, float x2, float y2, float radius)
Draws an arc from the current point to (x2, y2) through (x1, y1) with the given radius.
Shape Primitives
Rect
public void Rect(float x, float y, float w, float h)
Adds a rectangle to the current path.
RoundedRect
public void RoundedRect(float x, float y, float w, float h, float r)
public void RoundedRect(float x, float y, float w, float h, float rTopLeft, float rTopRight, float rBottomRight, float rBottomLeft)
Adds a rounded rectangle with uniform or per-corner radii.
BevelledRect
public void BevelledRect(float x, float y, float w, float h, float b)
public void BevelledRect(float x, float y, float w, float h, float bTopLeft, float bTopRight, float bBottomRight, float bBottomLeft)
Adds a bevelled rectangle with uniform or per-corner bevel sizes.
Circle
public void Circle(float cx, float cy, float r)
Adds a circle to the current path.
Ellipse
public void Ellipse(float cx, float cy, float rx, float ry)
Adds an ellipse to the current path.
Drawing Operations
Fill
public void Fill()
Fills the current path with the current fill style using the non-zero winding rule.
FillEvenOdd
public void FillEvenOdd()
Fills the current path using the even-odd winding rule.
Stroke
public void Stroke()
Strokes the current path with the current stroke style.
Clip
public void Clip()
Sets the current path as a clipping region.
Convenience Methods
FillRect
public void FillRect(float x, float y, float w, float h)
Draws a filled rectangle (equivalent to BeginPath + Rect + Fill).
StrokeRect
public void StrokeRect(float x, float y, float w, float h)
Draws a stroked rectangle.
FillCircle
public void FillCircle(float cx, float cy, float r)
Draws a filled circle.
StrokeCircle
public void StrokeCircle(float cx, float cy, float r)
Draws a stroked circle.
Text Rendering
Text
public AxisAlignedBounds2D Text(float x, float y, float width, string text)
Renders text at the specified position.
| Parameter | Type | Description |
|---|---|---|
x, y | float | Text position |
width | float | Maximum width for wrapping |
text | string | Text content |
Returns: AxisAlignedBounds2D - The bounds of the rendered text.
SetFont
public void SetFont(VectorFont font)
Sets the font for text rendering.
SetFontSize
public void SetFontSize(float size)
Sets the font size in pixels.
SetFontWeight
public void SetFontWeight(ushort weight)
Sets the font weight (100-900, 400=normal, 700=bold).
SetFontStyle
public void SetFontStyle(FontStyle style)
Sets the font style (normal, italic, oblique).
SetFontStretch
public void SetFontStretch(float stretch)
Sets the font stretch (1.0 = normal).
SetCharSpacing
public void SetCharSpacing(float spacing)
Sets character spacing (tracking) in em units.
SetTextLineHeight
public void SetTextLineHeight(float height)
Sets line height in em units.
SetTextAlignment
public void SetTextAlignment(TextAlignment alignment)
Sets text alignment (Left, Right, Center).
SetTextBaseline
public void SetTextBaseline(TextBaseline baseline)
Sets the vertical anchor point (Top, Middle, Alphabetic, Bottom).
SetTextScale
public void SetTextScale(float x, float y)
Sets per-glyph scale transform.
SetTextSkew
public void SetTextSkew(float skew)
Sets skew/slant value (positive = slant right).
Text Effects
SetTextEffect
public void SetTextEffect(TextEffect effectFlags)
Sets text effect flags (bitmask).
Flags:
TextEffect.NoneTextEffect.Fill- Render filled glyphsTextEffect.Shadow- Drop shadowTextEffect.Outline- Expanded outlineTextEffect.Stroke- Stroked outline
SetTextFillColor
public void SetTextFillColor(Color32 color)
Sets the primary text fill color.
SetTextStrokeColor
public void SetTextStrokeColor(Color32 color)
Sets the text stroke color.
SetTextStrokeWidth
public void SetTextStrokeWidth(float width)
Sets text stroke width in em units.
SetTextStrokeCapType
public void SetTextStrokeCapType(StrokeCapType capType)
SetTextStrokeJoinType
public void SetTextStrokeJoinType(StrokeJoinType joinType)
SetTextStrokeMiterLimit
public void SetTextStrokeMiterLimit(float limit)
SetTextOutlineColor
public void SetTextOutlineColor(Color32 color)
Sets the text outline color.
SetTextOutlineSize
public void SetTextOutlineSize(float size)
Sets outline expansion size in em units.
SetTextOutlineOffset
public void SetTextOutlineOffset(float x, float y)
Sets outline offset in em units.
SetTextOutlineMiterLimit
public void SetTextOutlineMiterLimit(float limit)
SetTextOutlineJoinType
public void SetTextOutlineJoinType(StrokeJoinType joinType)
SetTextShadowColor
public void SetTextShadowColor(Color32 color)
Sets the text shadow color.
SetTextShadowOffset
public void SetTextShadowOffset(float x, float y)
Sets shadow offset in em units.
Text Gradients
SetTextFillGradientSpace
public void SetTextFillGradientSpace(TextGradientSpace space)
Sets gradient coordinate space for text fill.
Spaces:
TextGradientSpace.Em- Normalized to font em-squareTextGradientSpace.Layout- Normalized to text boundsTextGradientSpace.World- Pixel coordinates
SetTextFillGradient
public void SetTextFillGradient(CanvasGradient gradient)
SetTextFillLinearGradient
public void SetTextFillLinearGradient(float sx, float sy, float ex, float ey, Color32 startColor, Color32 endColor)
public void SetTextFillLinearGradient(float sx, float sy, float ex, float ey, ColorStop[] colorStops)
SetTextFillRadialGradient
public void SetTextFillRadialGradient(float cx, float cy, float radius, Color32 innerColor, Color32 outerColor)
public void SetTextFillRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, Color32 innerColor, Color32 outerColor)
SetTextFillConicGradient
public void SetTextFillConicGradient(float cx, float cy, float startAngle, Color32 startColor, Color32 endColor)
Similar methods exist for stroke, outline, and shadow:
SetTextStrokeGradientSpace,SetTextStrokeGradient,SetTextStrokeLinearGradient, etc.SetTextOutlineGradientSpace,SetTextOutlineGradient,SetTextOutlineLinearGradient, etc.SetTextShadowGradientSpace,SetTextShadowGradient,SetTextShadowLinearGradient, etc.
Text Decorations
SetTextUnderline
public void SetTextUnderline(bool enabled)
public void SetTextUnderline(Color32 color)
Enable/disable underline or enable with specific color.
SetTextStrikethrough
public void SetTextStrikethrough(bool enabled)
public void SetTextStrikethrough(Color32 color)
Enable/disable strikethrough or enable with specific color.
SetTextUnderlineGradientSpace
public void SetTextUnderlineGradientSpace(TextGradientSpace space)
SetTextUnderlineGradient
public void SetTextUnderlineGradient(CanvasGradient gradient)
SetTextStrikethroughGradientSpace
public void SetTextStrikethroughGradientSpace(TextGradientSpace space)
SetTextStrikethroughGradient
public void SetTextStrikethroughGradient(CanvasGradient gradient)
Variable Font Axes
SetAxisVariation
public void SetAxisVariation(string tag, float value)
Sets a variable font axis variation.
| Parameter | Type | Description |
|---|---|---|
tag | string | 4-character axis tag (e.g., "wght", "wdth") |
value | float | Axis value |
ClearAxisVariations
public void ClearAxisVariations()
Clears all runtime axis variations.
Path Shadows
SetShadowOffset
public void SetShadowOffset(float x, float y)
Sets the generic path shadow offset in pixels.
SetShadowColor
public void SetShadowColor(Color32 color)
Sets the generic path shadow color.
Class: CanvasGradient
namespace EvolveUI.Rendering
public unsafe class CanvasGradient
Represents a reusable gradient definition.
Static Factory Methods
CreateLinearGradient
public static CanvasGradient CreateLinearGradient(float x0, float y0, float x1, float y1)
public static CanvasGradient CreateLinearGradient(float x0, float y0, float x1, float y1, params ColorStop[] colorStops)
Creates a linear gradient from (x0, y0) to (x1, y1).
CreateRadialGradient
public static CanvasGradient CreateRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1)
public static CanvasGradient CreateRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, params ColorStop[] colorStops)
Creates a radial gradient between two circles.
CreateConicGradient
public static CanvasGradient CreateConicGradient(float startAngle, float cx, float cy)
public static CanvasGradient CreateConicGradient(float startAngle, float cx, float cy, params ColorStop[] colorStops)
Creates a conic gradient centered at (cx, cy).
Instance Methods
AddColorStop
public void AddColorStop(float position, Color32 color)
Adds a color stop with linear interpolation.
| Parameter | Type | Description |
|---|---|---|
position | float | Position from 0.0 to 1.0 |
color | Color32 | Color at this position (sRGB) |
AddColorStopStep
public void AddColorStopStep(float position, Color32 color)
Adds a color stop with step interpolation (hard edge).
AddColorStopLinear
public void AddColorStopLinear(float position, float r, float g, float b, float a = 1f)
Adds a color stop using linear (not sRGB) color values.
AddColorStops
public void AddColorStops(params ColorStop[] colorStops)
Adds multiple color stops at once.
ClearStops
public void ClearStops()
Clears all color stops from the gradient.
StopCount
public int StopCount { get; }
Gets the number of color stops in the gradient.
Struct: ColorStop
namespace EvolveUI.Rendering
public struct ColorStop
A color stop for gradient definitions.
Fields
| Field | Type | Description |
|---|---|---|
position | float | Position from 0.0 to 1.0 |
color | Color32 | Color at this position |
interpolation | ColorStopInterpolation | Interpolation mode to next stop |
Constructor
public ColorStop(float position, Color32 color, ColorStopInterpolation interpolation = ColorStopInterpolation.Linear)
Font Loading (UIAssetManager)
The UIAssetManager class provides methods for loading fonts at runtime for use with Canvas text rendering.
LoadVectorFont
public VectorFont LoadVectorFont(string filePath, string fontName = null, float scale = 1.0f, float offset = 0.0f)
Loads a font from a file path and creates a VectorFont instance.
| Parameter | Type | Description |
|---|---|---|
filePath | string | Path to the font file (.ttf, .otf, etc.) |
fontName | string | Optional name for the font. If null, uses the filename. |
scale | float | Scale factor for the font (default: 1.0) |
offset | float | Vertical offset for the font (default: 0.0) |
Returns: VectorFont - A font instance for use with Canvas.SetFont().
Throws: ArgumentNullException if filePath is null or empty. FileNotFoundException if file doesn't exist.
LoadVectorFontFromMemory
public VectorFont LoadVectorFontFromMemory(byte[] fontData, string fontName, float scale = 1.0f, float offset = 0.0f)
Loads a font from a byte array in memory.
| Parameter | Type | Description |
|---|---|---|
fontData | byte[] | Font file data in memory |
fontName | string | Name for the font (required) |
scale | float | Scale factor for the font (default: 1.0) |
offset | float | Vertical offset for the font (default: 0.0) |
Returns: VectorFont - A font instance for use with Canvas.SetFont().
Throws: ArgumentNullException if fontData or fontName is null/empty.
FindVectorFont
public VectorFont FindVectorFont(string fontName)
Finds a previously loaded vector font by name.
| Parameter | Type | Description |
|---|---|---|
fontName | string | Name of the font to find |
Returns: VectorFont - The font instance if found, or default if not found.
HasVectorFont
public bool HasVectorFont(string fontName)
Checks if a vector font with the given name has been loaded.
| Parameter | Type | Description |
|---|---|---|
fontName | string | Name of the font to check |
Returns: bool - True if the font exists, false otherwise.
SetGlobalFallbackFont
public void SetGlobalFallbackFont(VectorFont font)
Sets the global fallback font used when a character is not found in the primary font. Useful for emoji fonts or special character sets.
| Parameter | Type | Description |
|---|---|---|
font | VectorFont | The font to use as fallback, or default to clear |
GetGlobalFallbackFont
public VectorFont GetGlobalFallbackFont()
Gets the current global fallback font.
Returns: VectorFont - The global fallback font, or default if none is set.
CreateFontChain
public VectorFont CreateFontChain(string chainName, params VectorFont[] fonts)
Creates a font chain from multiple fonts. When rendering text, if a character is not found in the first font, subsequent fonts in the chain are tried in order.
| Parameter | Type | Description |
|---|---|---|
chainName | string | Name for the font chain |
fonts | VectorFont[] | Array of fonts to include, in priority order |
Returns: VectorFont - A font representing the chain.
Throws: ArgumentNullException if chainName is null/empty. ArgumentException if fonts is empty.
CreateFontFamily
public VectorFont CreateFontFamily(string familyName, params FontFamilyMemberInfo[] members)
Creates a font family from multiple font faces with different weights and styles. The appropriate face is automatically selected based on the current font weight and style settings.
| Parameter | Type | Description |
|---|---|---|
familyName | string | Name for the font family |
members | FontFamilyMemberInfo[] | Array of family members with weight/style info |
Returns: VectorFont - A font representing the family.
Throws: ArgumentNullException if familyName is null/empty. ArgumentException if members is empty or contains invalid FontInfo.
LoadFontInfo
public FontInfo LoadFontInfo(string filePath, string fontName = null)
Loads font info from a file path. FontInfo is an intermediate representation that can be used to create fonts or font family members.
| Parameter | Type | Description |
|---|---|---|
filePath | string | Path to the font file (.ttf, .otf, etc.) |
fontName | string | Optional name for the font info. If null, uses the filename. |
Returns: FontInfo - A font info instance.
Throws: ArgumentNullException if filePath is null/empty. FileNotFoundException if file doesn't exist.
LoadFontInfoFromMemory
public FontInfo LoadFontInfoFromMemory(byte[] fontData, string fontName)
Loads font info from a byte array in memory.
| Parameter | Type | Description |
|---|---|---|
fontData | byte[] | Font file data in memory |
fontName | string | Name for the font info (required) |
Returns: FontInfo - A font info instance.
Throws: ArgumentNullException if fontData or fontName is null/empty.
Struct: FontInfo
namespace EvolveUI.Native
public struct FontInfo
Represents loaded font metadata used to create fonts or font family members. Obtained via UIAssetManager.LoadFontInfo() or UIAssetManager.LoadFontInfoFromMemory().
Struct: FontFamilyMemberInfo
namespace EvolveUI
public struct FontFamilyMemberInfo
Information for a single member of a font family (one weight/style combination).
Constructor
public FontFamilyMemberInfo(FontInfo fontInfo, ushort weight, FontStyle style = FontStyle.Normal, float scale = 1.0f, float offset = 0.0f)
Fields
| Field | Type | Description |
|---|---|---|
fontInfo | FontInfo | The FontInfo for this family member |
weight | ushort | Font weight (100-900). 400=Regular, 700=Bold |
style | FontStyle | Font style (Normal, Italic, or Oblique) |
scale | float | Scale factor (default: 1.0) |
offset | float | Vertical offset for baseline adjustment (default: 0.0) |
Struct: VectorFont
namespace EvolveUI
public struct VectorFont
Represents a loaded vector font for use with Canvas text rendering. Obtained via UIAssetManager.LoadVectorFont() or UIAssetManager.FindVectorFont().
Properties
| Property | Type | Description |
|---|---|---|
IsValid | bool | Returns true if this represents a valid loaded font |
Enum: ColorStopInterpolation
namespace EvolveUI.Rendering
public enum ColorStopInterpolation
| Value | Description |
|---|---|
Linear | Smooth blend to next stop (in OkLab color space) |
Step | Hold color until next stop (hard edge) |
Enum: StrokeCapType
namespace EvolveUI.Native
public enum StrokeCapType : byte
| Value | Description |
|---|---|
None | No cap |
Flat | Flat cap at endpoint |
Triangle | Triangular cap |
Square | Square cap extending past endpoint |
Round | Rounded cap |
Enum: StrokeJoinType
namespace EvolveUI.Native
public enum StrokeJoinType : byte
| Value | Description |
|---|---|
Miter | Sharp corners (falls back to bevel when exceeding miter limit) |
Bevel | Beveled corners |
Round | Rounded corners |
Enum: PatternSpace
namespace EvolveUI.Native
public enum PatternSpace : byte
| Value | Description |
|---|---|
Bounds | UVs are [0,1] within shape bounds (CSS-like) |
World | UVs are world/pixel coordinates (Canvas pattern-like) |
Enum: PatternSizing
namespace EvolveUI.Native
public enum PatternSizing : byte
| Value | Description |
|---|---|
Stretch | Fill bounds, ignore aspect ratio |
Contain | Fit inside bounds, preserve aspect ratio (letterbox) |
Cover | Cover bounds, preserve aspect ratio (may crop) |
Tile | Tile at specified size |
Enum: PatternRepeat
namespace EvolveUI.Native
public enum PatternRepeat : byte
| Value | Description |
|---|---|
NoRepeat | Clamp to edges |
Repeat | Tile both axes |
RepeatX | Tile X axis, clamp Y |
RepeatY | Tile Y axis, clamp X |
Enum: TextAlignment
namespace EvolveUI.Native
public enum TextAlignment : byte
| Value | Description |
|---|---|
Left | Left-aligned text |
Right | Right-aligned text |
Center | Center-aligned text |
Enum: TextBaseline
namespace EvolveUI.Native
public enum TextBaseline : byte
| Value | Description |
|---|---|
Top | y = top of text block |
Middle | y = middle of first line's em square |
Alphabetic | y = alphabetic baseline (HTML Canvas default) |
Bottom | y = bottom of text block |
Enum: TextEffect
namespace EvolveUI.Native
[Flags]
public enum TextEffect : byte
| Value | Description |
|---|---|
None | No effects |
Fill | Render filled glyphs (base text) |
Shadow | Drop shadow rendered beneath |
Outline | Expanded outline rendered beneath |
Stroke | Stroked outline rendered on top |
Enum: TextGradientSpace
namespace EvolveUI.Native
public enum TextGradientSpace : byte
| Value | Description |
|---|---|
Em | Normalized to font em-square (0-1, per-glyph) |
Layout | Normalized to text layout bounds (0-1) |
World | Pixel coordinates (same as fill/stroke gradients) |
Struct: EVGTransform
namespace EvolveUI.Native
public struct EVGTransform
2D transformation matrix.
Fields
| Field | Type | Description |
|---|---|---|
a | float | Scale X / Rotation |
b | float | Skew Y |
c | float | Skew X |
d | float | Scale Y / Rotation |
e | float | Translate X |
f | float | Translate Y |
Matrix representation:
| a c e | | x | | ax + cy + e |
| b d f | * | y | = | bx + dy + f |
| 0 0 1 | | 1 | | 1 |