Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Drawing.SvgResource Class Referencesealed

Represents a loaded SVG asset that can be rasterized into cached bitmaps at requested sizes. More...

Inheritance diagram for Gondwana.Drawing.SvgResource:

Public Member Functions

SKBitmap Rasterize (int width, int height)
 Rasterizes this SVG to an explicit pixel size.
SKBitmap Rasterize (float scale=1.0f)
 Rasterizes this SVG to its intrinsic size multiplied by a scale factor.
void Dispose ()

Static Public Member Functions

static SvgResource Load (string path)
 Loads an SVG resource from a file path.

Properties

SizeF IntrinsicSize [get]
 Gets the intrinsic (unscaled) SVG size in pixels.

Detailed Description

Represents a loaded SVG asset that can be rasterized into cached bitmaps at requested sizes.

Definition at line 10 of file SvgResource.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.Drawing.SvgResource.Dispose ( )

Definition at line 119 of file SvgResource.cs.

◆ Load()

SvgResource Gondwana.Drawing.SvgResource.Load ( string path)
static

Loads an SVG resource from a file path.

Parameters
pathThe SVG file path.
Returns
A loaded SvgResource instance.

Definition at line 28 of file SvgResource.cs.

◆ Rasterize() [1/2]

SKBitmap Gondwana.Drawing.SvgResource.Rasterize ( float scale = 1::0f)

Rasterizes this SVG to its intrinsic size multiplied by a scale factor.

Parameters
scaleScale factor where 1.0 maps to intrinsic size.
Returns
A cached rasterized bitmap for the requested scale.

Definition at line 106 of file SvgResource.cs.

◆ Rasterize() [2/2]

SKBitmap Gondwana.Drawing.SvgResource.Rasterize ( int width,
int height )

Rasterizes this SVG to an explicit pixel size.

Parameters
widthOutput width in pixels.
heightOutput height in pixels.
Returns
A cached rasterized bitmap for the requested size.

The cache is keyed by output size. Repeated requests for the same size return the same bitmap instance. Cached bitmaps remain valid until this SvgResource is disposed.

Definition at line 67 of file SvgResource.cs.

Property Documentation

◆ IntrinsicSize

SizeF Gondwana.Drawing.SvgResource.IntrinsicSize
get

Gets the intrinsic (unscaled) SVG size in pixels.

Definition at line 55 of file SvgResource.cs.