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.Tilesheets.TilesheetRegion Class Referencesealed

Represents a rectangular region within a tilesheet that contains a grid of frames. More...

Inheritance diagram for Gondwana.Drawing.Tilesheets.TilesheetRegion:

Public Member Functions

SKImage? GetImage (int x, int y)
 Gets the cached image for the specified frame.
SKBitmap? GetBitmap (int x, int y)
 Gets the cached bitmap for the specified frame.
Dictionary<(int x, int y), SKBitmap > GetAllBitmaps ()
 Collects the cached frame bitmaps indexed by their tile coordinates.
Dictionary<(int x, int y), SKImage > GetAllImages ()
 Collects the cached frame images indexed by their tile coordinates.
CollisionAdjust GetFrameCollisionAdjust (int x, int y)
 Gets the effective collision adjustment for one frame.
bool TryGetFrameCollisionAdjustOverride (int x, int y, out CollisionAdjust collisionAdjust)
 Attempts to get the explicit collision adjustment assigned to one frame.
void SetFrameCollisionAdjust (int x, int y, CollisionAdjust collisionAdjust)
 Sets the collision adjustment for one frame and updates its cache entry.
bool ClearFrameCollisionAdjustOverride (int x, int y)
 Removes a frame-level collision adjustment so the frame once again inherits CollisionAdjust.
Rectangle GetFrameCollisionArea (int x, int y)
 Gets the frame-local collision rectangle for one frame.
TileCollisionType GetFrameCollisionType (int x, int y)
 Gets the effective collision type for one frame.
bool TryGetFrameCollisionTypeOverride (int x, int y, out TileCollisionType collisionType)
 Attempts to get the explicit collision type assigned to one frame.
void SetFrameCollisionType (int x, int y, TileCollisionType collisionType)
 Sets an explicit collision type for one frame.
bool ClearFrameCollisionTypeOverride (int x, int y)
 Removes a frame-level collision type so the frame once again inherits CollisionType.
void Dispose ()
 Releases the resources owned by this instance.

Static Public Attributes

static readonly string DefaultRegionName = "default"
 The default name assigned to tilesheet regions when no name is specified.

Properties

Tilesheet Tilesheet = null! [get]
 Gets the tilesheet that owns this region.
string Name = DefaultRegionName [get]
 Gets the region name.
Rectangle Area [get, set]
 Gets or sets the region bounds in tilesheet image pixels.
Size TileSize [get, set]
 Gets or sets the tile dimensions in pixels.
Spacing TilePadding [get, set]
 Gets or sets the spacing around each tile.
Spacing RegionMargin [get, set]
 Gets or sets the spacing inside the region boundary.
Spacing Overhang = Spacing.None [get, set]
 Gets or sets visual overhang. This affects rendering, not slicing.
CollisionAdjust CollisionAdjust [get, set]
 Gets or sets the collision adjustment inherited by frames that do not have an explicit frame-level override.
Rectangle CollisionArea [get]
 Gets the region-default frame-local collision rectangle.
TileCollisionType CollisionType [get, set]
 Gets or sets the collision type inherited by frames that do not have an explicit frame-level override.
int Columns [get]
 Gets the number of tile columns in the region.
int Rows [get]
 Gets the number of tile rows in the region.
int TileWidthIncludingPadding [get]
 Gets the horizontal tile stride including padding.
int TileHeightIncludingPadding [get]
 Gets the vertical tile stride including padding.

Detailed Description

Represents a rectangular region within a tilesheet that contains a grid of frames.

Definition at line 11 of file TilesheetRegion.cs.

Member Function Documentation

◆ ClearFrameCollisionAdjustOverride()

bool Gondwana.Drawing.Tilesheets.TilesheetRegion.ClearFrameCollisionAdjustOverride ( int x,
int y )

Removes a frame-level collision adjustment so the frame once again inherits CollisionAdjust.

Returns
true when an explicit frame override was removed; otherwise, false.
Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.

Definition at line 365 of file TilesheetRegion.cs.

◆ ClearFrameCollisionTypeOverride()

bool Gondwana.Drawing.Tilesheets.TilesheetRegion.ClearFrameCollisionTypeOverride ( int x,
int y )

Removes a frame-level collision type so the frame once again inherits CollisionType.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
Returns
true if the frame had a collision type override that was cleared; otherwise, false.

Definition at line 472 of file TilesheetRegion.cs.

◆ Dispose()

void Gondwana.Drawing.Tilesheets.TilesheetRegion.Dispose ( )

Releases the resources owned by this instance.

Definition at line 682 of file TilesheetRegion.cs.

◆ GetAllBitmaps()

Dictionary<(int x, int y), SKBitmap > Gondwana.Drawing.Tilesheets.TilesheetRegion.GetAllBitmaps ( )

Collects the cached frame bitmaps indexed by their tile coordinates.

Returns
A dictionary of cached bitmaps keyed by frame coordinates. The tilesheet retains ownership of the bitmaps.

Definition at line 227 of file TilesheetRegion.cs.

◆ GetAllImages()

Dictionary<(int x, int y), SKImage > Gondwana.Drawing.Tilesheets.TilesheetRegion.GetAllImages ( )

Collects the cached frame images indexed by their tile coordinates.

Returns
A dictionary of cached images keyed by frame coordinates. The tilesheet retains ownership of the images.

Definition at line 254 of file TilesheetRegion.cs.

◆ GetBitmap()

SKBitmap? Gondwana.Drawing.Tilesheets.TilesheetRegion.GetBitmap ( int x,
int y )

Gets the cached bitmap for the specified frame.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
Returns
The cached frame bitmap, or null if the frame is unavailable. The tilesheet retains ownership.

Definition at line 206 of file TilesheetRegion.cs.

◆ GetFrameCollisionAdjust()

CollisionAdjust Gondwana.Drawing.Tilesheets.TilesheetRegion.GetFrameCollisionAdjust ( int x,
int y )

Gets the effective collision adjustment for one frame.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
Returns
The frame override, or the region default when no override is present.

Definition at line 283 of file TilesheetRegion.cs.

◆ GetFrameCollisionArea()

Rectangle Gondwana.Drawing.Tilesheets.TilesheetRegion.GetFrameCollisionArea ( int x,
int y )

Gets the frame-local collision rectangle for one frame.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
Returns
The frame collision rectangle after applying its effective collision adjustment.

◆ GetFrameCollisionType()

TileCollisionType Gondwana.Drawing.Tilesheets.TilesheetRegion.GetFrameCollisionType ( int x,
int y )

Gets the effective collision type for one frame.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
Returns
The frame collision type override, or the inherited region default.

Definition at line 404 of file TilesheetRegion.cs.

◆ GetImage()

SKImage? Gondwana.Drawing.Tilesheets.TilesheetRegion.GetImage ( int x,
int y )

Gets the cached image for the specified frame.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
Returns
The cached frame image, or null if the frame is unavailable. The tilesheet retains ownership.

Definition at line 183 of file TilesheetRegion.cs.

◆ SetFrameCollisionAdjust()

void Gondwana.Drawing.Tilesheets.TilesheetRegion.SetFrameCollisionAdjust ( int x,
int y,
CollisionAdjust collisionAdjust )

Sets the collision adjustment for one frame and updates its cache entry.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
collisionAdjustThe adjustment applied to the frame's collision bounds.

Definition at line 335 of file TilesheetRegion.cs.

◆ SetFrameCollisionType()

void Gondwana.Drawing.Tilesheets.TilesheetRegion.SetFrameCollisionType ( int x,
int y,
TileCollisionType collisionType )

Sets an explicit collision type for one frame.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
collisionTypeThe collision type.

Definition at line 448 of file TilesheetRegion.cs.

◆ TryGetFrameCollisionAdjustOverride()

bool Gondwana.Drawing.Tilesheets.TilesheetRegion.TryGetFrameCollisionAdjustOverride ( int x,
int y,
out CollisionAdjust collisionAdjust )

Attempts to get the explicit collision adjustment assigned to one frame.

Returns true when an explicit frame-level override exists. When false, no override exists (the frame inherits CollisionAdjust). The collisionAdjust out parameter is only meaningful when the method returns true.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
collisionAdjustWhen this method returns, contains the collision adjust.
Returns
true if the operation succeeded; otherwise, false.

Definition at line 308 of file TilesheetRegion.cs.

◆ TryGetFrameCollisionTypeOverride()

bool Gondwana.Drawing.Tilesheets.TilesheetRegion.TryGetFrameCollisionTypeOverride ( int x,
int y,
out TileCollisionType collisionType )

Attempts to get the explicit collision type assigned to one frame.

Parameters
xThe zero-based column in the tile grid.
yThe zero-based row in the tile grid.
collisionTypeWhen this method returns, contains the collision type.
Returns
true if the operation succeeded; otherwise, false.

Definition at line 423 of file TilesheetRegion.cs.

Member Data Documentation

◆ DefaultRegionName

readonly string Gondwana.Drawing.Tilesheets.TilesheetRegion.DefaultRegionName = "default"
static

The default name assigned to tilesheet regions when no name is specified.

Definition at line 16 of file TilesheetRegion.cs.

Property Documentation

◆ Area

Rectangle Gondwana.Drawing.Tilesheets.TilesheetRegion.Area
getset

Gets or sets the region bounds in tilesheet image pixels.

Definition at line 71 of file TilesheetRegion.cs.

◆ CollisionAdjust

CollisionAdjust Gondwana.Drawing.Tilesheets.TilesheetRegion.CollisionAdjust
getset

Gets or sets the collision adjustment inherited by frames that do not have an explicit frame-level override.

Definition at line 129 of file TilesheetRegion.cs.

◆ CollisionArea

Rectangle Gondwana.Drawing.Tilesheets.TilesheetRegion.CollisionArea
get

Gets the region-default frame-local collision rectangle.

Definition at line 143 of file TilesheetRegion.cs.

◆ CollisionType

TileCollisionType Gondwana.Drawing.Tilesheets.TilesheetRegion.CollisionType
getset

Gets or sets the collision type inherited by frames that do not have an explicit frame-level override.

Definition at line 150 of file TilesheetRegion.cs.

◆ Columns

int Gondwana.Drawing.Tilesheets.TilesheetRegion.Columns
get

Gets the number of tile columns in the region.

Definition at line 163 of file TilesheetRegion.cs.

◆ Name

string Gondwana.Drawing.Tilesheets.TilesheetRegion.Name = DefaultRegionName
get

Gets the region name.

Definition at line 66 of file TilesheetRegion.cs.

◆ Overhang

Spacing Gondwana.Drawing.Tilesheets.TilesheetRegion.Overhang = Spacing.None
getset

Gets or sets visual overhang. This affects rendering, not slicing.

Definition at line 123 of file TilesheetRegion.cs.

◆ RegionMargin

Spacing Gondwana.Drawing.Tilesheets.TilesheetRegion.RegionMargin
getset

Gets or sets the spacing inside the region boundary.

Definition at line 110 of file TilesheetRegion.cs.

◆ Rows

int Gondwana.Drawing.Tilesheets.TilesheetRegion.Rows
get

Gets the number of tile rows in the region.

Definition at line 167 of file TilesheetRegion.cs.

◆ TileHeightIncludingPadding

int Gondwana.Drawing.Tilesheets.TilesheetRegion.TileHeightIncludingPadding
get

Gets the vertical tile stride including padding.

Definition at line 175 of file TilesheetRegion.cs.

◆ TilePadding

Spacing Gondwana.Drawing.Tilesheets.TilesheetRegion.TilePadding
getsetadd

Gets or sets the spacing around each tile.

Definition at line 97 of file TilesheetRegion.cs.

◆ Tilesheet

Tilesheet Gondwana.Drawing.Tilesheets.TilesheetRegion.Tilesheet = null!
get

Gets the tilesheet that owns this region.

Definition at line 61 of file TilesheetRegion.cs.

◆ TileSize

Size Gondwana.Drawing.Tilesheets.TilesheetRegion.TileSize
getset

Gets or sets the tile dimensions in pixels.

Definition at line 84 of file TilesheetRegion.cs.

◆ TileWidthIncludingPadding

int Gondwana.Drawing.Tilesheets.TilesheetRegion.TileWidthIncludingPadding
get

Gets the horizontal tile stride including padding.

Definition at line 171 of file TilesheetRegion.cs.