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.Tile Class Referenceabstract

Represents an abstract base class for drawable tiles in the Gondwana engine. Provides core functionality for rendering, animation, collision detection, and scene layer integration. More...

Inheritance diagram for Gondwana.Drawing.Tile:
Gondwana.Drawing.IDrawable Gondwana.Physics.Collisions.ICollisionEntity Gondwana.Drawing.Sprites.Sprite Gondwana.Scenes.SceneLayerTile

Public Member Functions

virtual RectangleF GetDrawLocationScreen (View view)
 Transforms the drawable bounds into screen pixels for the specified view.
virtual RectangleF GetCollisionAreaScreen (View view)
 Transforms the collision bounds into screen pixels for the specified view.
virtual void Draw (BackbufferBase backbuffer, RectangleF destRectScreen)
 Draws the current content into the backbuffer at the supplied screen-pixel bounds.
void SetCollisionProfile (string profileName)
 Applies a named profile from this tile's parent scene. If the layer has not yet been attached to a scene, the name is retained and resolved later when the collider is attached or the profile is reapplied.
int CompareTo (Tile? tile)
 Compares this tile with another tile using their render ordering.
virtual void Dispose ()
 Releases the resources owned by this instance.

Protected Member Functions

void CopyCollisionSettingsFrom (Tile source)
 Copies collision behavior, profile, and effective frame metadata from another tile.
void DetachCollider ()
 Detaches the current collider from its scene-layer registry without otherwise changing this tile's serialized collision state.
void AttachCollider (ICollider collider)
 Attaches this tile's collider and applies any collision state that was set before the collider became available.

Protected Attributes

bool pauseAnimation
 The pause animation.
ICollider? _collider
 The collider.

Properties

static List< Tile > TilesAnimating = new() [get]
 Gets the collection of all tiles that are currently animating in the scene.
bool IsPositionFixed [get]
 Gets whether the tile occupies a fixed position in its layer.
Rectangle DrawLocationWorld [get]
 Gets the tile drawing bounds in world pixels.
PointF SceneLayerCoordinates [get]
 Gets the position in scene-layer grid coordinates.
SceneLayer SceneLayer [get]
 Gets the scene layer that owns this tile.
Guid Id = Guid.NewGuid() [get, set]
 Gets the unique identifier.
string? Nickname [get, set]
 Gets or sets the optional lookup name.
virtual bool Visible [get, set]
 Gets or sets whether this drawable is visible.
virtual int ZOrder [get, set]
 Gets or sets the drawing order within the layer.
virtual Spacing Overhang [get]
 Gets the current frame's visual overhang beyond its tile bounds.
virtual Frame CurrentFrame [get, set]
 Gets or sets the current frame. The initial frame supplies the tile's default collision adjustment and collision type. Later frame changes update those values only when their corresponding by-frame options are enabled.
virtual Animator TileAnimator [get]
 Gets the animator associated with this tile.
virtual bool PauseAnimation [get, set]
 Gets or sets whether animation is paused.
virtual ? ICollider Collider [get]
 Gets the collision shape associated with this tile.
virtual Rectangle CollisionArea [get]
 Gets the effective collision area in world coordinates.
virtual bool EnableFog [get, set]
 Gets or sets whether scene-layer fog applies to this tile.
virtual Point[] OutlinePointsWorld [get]
 Gets the tile outline vertices in world pixels.
virtual bool AdjustCollisionAreaByFrame [get, set]
 Gets or sets whether frame changes replace the tile's collision adjustment with the newly selected frame's adjustment.
virtual CollisionAdjust AdjustCollisionArea [get, set]
 Gets or sets the collision adjustment used to derive CollisionArea.
virtual TileCollisionType CollisionType [get, set]
 Gets or sets the tile's collision behavior. This is initialized from the first assigned frame and may subsequently be overridden per tile.
virtual bool CollisionTypeByFrame [get, set]
 Gets or sets whether frame changes replace this tile's collision type with the newly selected frame's effective collision type.
string? CollisionProfileName [get]
 Gets the scene-level collision profile currently associated with this tile.
bool CollisionsEnabled [get, set]
 Gets or sets whether this tile participates in collision detection.
TypedValueBag ValueBag = new() [get]
 Gets the custom typed values associated with this object.

Detailed Description

Represents an abstract base class for drawable tiles in the Gondwana engine. Provides core functionality for rendering, animation, collision detection, and scene layer integration.

Definition at line 18 of file Tile.cs.

Member Function Documentation

◆ AttachCollider()

void Gondwana.Drawing.Tile.AttachCollider ( ICollider collider)
protected

Attaches this tile's collider and applies any collision state that was set before the collider became available.

Parameters
colliderThe collider.

Definition at line 504 of file Tile.cs.

◆ CompareTo()

int Gondwana.Drawing.Tile.CompareTo ( Tile? tile)

Compares this tile with another tile using their render ordering.

Parameters
tileThe tile.
Returns
A negative value, zero, or a positive value when this tile sorts before, with, or after the other tile. A null tile sorts after this instance.

Definition at line 536 of file Tile.cs.

◆ CopyCollisionSettingsFrom()

void Gondwana.Drawing.Tile.CopyCollisionSettingsFrom ( Tile source)
protected

Copies collision behavior, profile, and effective frame metadata from another tile.

Parameters
sourceThe source.

Definition at line 403 of file Tile.cs.

◆ DetachCollider()

void Gondwana.Drawing.Tile.DetachCollider ( )
protected

Detaches the current collider from its scene-layer registry without otherwise changing this tile's serialized collision state.

Definition at line 490 of file Tile.cs.

◆ Dispose()

virtual void Gondwana.Drawing.Tile.Dispose ( )
virtual

Releases the resources owned by this instance.

Reimplemented in Gondwana.Drawing.Sprites.Sprite, and Gondwana.Scenes.SceneLayerTile.

Definition at line 603 of file Tile.cs.

◆ Draw()

virtual void Gondwana.Drawing.Tile.Draw ( BackbufferBase backbuffer,
RectangleF destRectScreen )
virtual

Draws the current content into the backbuffer at the supplied screen-pixel bounds.

Parameters
backbufferThe backbuffer receiving the drawing commands.
destRectScreenThe destination rectangle in screen pixels.

Implements Gondwana.Drawing.IDrawable.

Reimplemented in Gondwana.Drawing.Sprites.Sprite, and Gondwana.Scenes.SceneLayerTile.

◆ GetCollisionAreaScreen()

virtual RectangleF Gondwana.Drawing.Tile.GetCollisionAreaScreen ( View view)
virtual

Transforms the collision bounds into screen pixels for the specified view.

Parameters
viewThe view used for presentation and coordinate conversion.
Returns
The bounds in screen pixels for the supplied view.

◆ GetDrawLocationScreen()

virtual RectangleF Gondwana.Drawing.Tile.GetDrawLocationScreen ( View view)
virtual

Transforms the drawable bounds into screen pixels for the specified view.

Parameters
viewThe view used for presentation and coordinate conversion.
Returns
The bounds in screen pixels for the supplied view.

Implements Gondwana.Drawing.IDrawable.

◆ SetCollisionProfile()

void Gondwana.Drawing.Tile.SetCollisionProfile ( string profileName)

Applies a named profile from this tile's parent scene. If the layer has not yet been attached to a scene, the name is retained and resolved later when the collider is attached or the profile is reapplied.

Parameters
profileNameThe name of the scene collision profile.

Definition at line 376 of file Tile.cs.

Member Data Documentation

◆ _collider

ICollider? Gondwana.Drawing.Tile._collider
protected

The collider.

Definition at line 58 of file Tile.cs.

◆ pauseAnimation

bool Gondwana.Drawing.Tile.pauseAnimation
protected

The pause animation.

Definition at line 54 of file Tile.cs.

Property Documentation

◆ AdjustCollisionArea

virtual CollisionAdjust Gondwana.Drawing.Tile.AdjustCollisionArea
getset

Gets or sets the collision adjustment used to derive CollisionArea.

Definition at line 284 of file Tile.cs.

◆ AdjustCollisionAreaByFrame

virtual bool Gondwana.Drawing.Tile.AdjustCollisionAreaByFrame
getset

Gets or sets whether frame changes replace the tile's collision adjustment with the newly selected frame's adjustment.

The default is false, which keeps the collision area static across animation frames after the initial frame supplies its default value.

Definition at line 268 of file Tile.cs.

◆ Collider

virtual ? ICollider Gondwana.Drawing.Tile.Collider
get

Gets the collision shape associated with this tile.

Definition at line 229 of file Tile.cs.

◆ CollisionArea

virtual Rectangle Gondwana.Drawing.Tile.CollisionArea
get

Gets the effective collision area in world coordinates.

Implements Gondwana.Physics.Collisions.ICollisionEntity.

Definition at line 235 of file Tile.cs.

◆ CollisionProfileName

string? Gondwana.Drawing.Tile.CollisionProfileName
get

Gets the scene-level collision profile currently associated with this tile.

Definition at line 330 of file Tile.cs.

◆ CollisionsEnabled

bool Gondwana.Drawing.Tile.CollisionsEnabled
getset

Gets or sets whether this tile participates in collision detection.

Definition at line 340 of file Tile.cs.

◆ CollisionType

virtual TileCollisionType Gondwana.Drawing.Tile.CollisionType
getset

Gets or sets the tile's collision behavior. This is initialized from the first assigned frame and may subsequently be overridden per tile.

Definition at line 299 of file Tile.cs.

◆ CollisionTypeByFrame

virtual bool Gondwana.Drawing.Tile.CollisionTypeByFrame
getset

Gets or sets whether frame changes replace this tile's collision type with the newly selected frame's effective collision type.

Definition at line 314 of file Tile.cs.

◆ CurrentFrame

virtual Frame Gondwana.Drawing.Tile.CurrentFrame
getset

Gets or sets the current frame. The initial frame supplies the tile's default collision adjustment and collision type. Later frame changes update those values only when their corresponding by-frame options are enabled.

Definition at line 175 of file Tile.cs.

◆ DrawLocationWorld

Rectangle Gondwana.Drawing.Tile.DrawLocationWorld
getabstract

Gets the tile drawing bounds in world pixels.

Definition at line 83 of file Tile.cs.

◆ EnableFog

virtual bool Gondwana.Drawing.Tile.EnableFog
getset

Gets or sets whether scene-layer fog applies to this tile.

Definition at line 242 of file Tile.cs.

◆ Id

Guid Gondwana.Drawing.Tile.Id = Guid.NewGuid()
getset

Gets the unique identifier.

Implements Gondwana.Drawing.IDrawable.

Definition at line 101 of file Tile.cs.

◆ IsPositionFixed

bool Gondwana.Drawing.Tile.IsPositionFixed
getabstract

Gets whether the tile occupies a fixed position in its layer.

Definition at line 79 of file Tile.cs.

◆ Nickname

string? Gondwana.Drawing.Tile.Nickname
getset

Gets or sets the optional lookup name.

Implements Gondwana.Drawing.IDrawable.

Definition at line 107 of file Tile.cs.

◆ OutlinePointsWorld

virtual Point [] Gondwana.Drawing.Tile.OutlinePointsWorld
get

Gets the tile outline vertices in world pixels.

Definition at line 256 of file Tile.cs.

◆ Overhang

virtual Spacing Gondwana.Drawing.Tile.Overhang
get

Gets the current frame's visual overhang beyond its tile bounds.

Definition at line 167 of file Tile.cs.

◆ PauseAnimation

virtual bool Gondwana.Drawing.Tile.PauseAnimation
getset

Gets or sets whether animation is paused.

Definition at line 223 of file Tile.cs.

◆ SceneLayer

SceneLayer Gondwana.Drawing.Tile.SceneLayer
getabstract

Gets the scene layer that owns this tile.

Definition at line 91 of file Tile.cs.

◆ SceneLayerCoordinates

PointF Gondwana.Drawing.Tile.SceneLayerCoordinates
getabstract

Gets the position in scene-layer grid coordinates.

Definition at line 87 of file Tile.cs.

◆ TileAnimator

virtual Animator Gondwana.Drawing.Tile.TileAnimator
get

Gets the animator associated with this tile.

Definition at line 217 of file Tile.cs.

◆ TilesAnimating

List<Tile> Gondwana.Drawing.Tile.TilesAnimating = new()
staticget

Gets the collection of all tiles that are currently animating in the scene.

Definition at line 25 of file Tile.cs.

◆ ValueBag

TypedValueBag Gondwana.Drawing.Tile.ValueBag = new()
get

Gets the custom typed values associated with this object.

Definition at line 368 of file Tile.cs.

◆ Visible

virtual bool Gondwana.Drawing.Tile.Visible
getset

Gets or sets whether this drawable is visible.

Implements Gondwana.Drawing.IDrawable.

Definition at line 113 of file Tile.cs.

◆ ZOrder

virtual int Gondwana.Drawing.Tile.ZOrder
getset

Gets or sets the drawing order within the layer.

Implements Gondwana.Drawing.IDrawable.

Definition at line 127 of file Tile.cs.