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.Scenes.SceneLayerTile Class Reference

Represents the values stored at a single location on a SceneLayer. More...

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

Public Member Functions

override void Draw (Gondwana.Rendering.Backbuffers.BackbufferBase backbuffer, RectangleF destRectScreen)
 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.

override void Dispose ()
 Releases the resources owned by this instance.
Public Member Functions inherited from Gondwana.Drawing.Tile
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.
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.

Properties

override bool EnableFog [get, set]
TileTransform Transform [get, set]
 Gets or sets this placement's orthogonal orientation without changing its source frame.
Size EffectiveTileSize [get]
 Gets source frame dimensions after placement orientation.
override Spacing Overhang [get]
 Gets oriented overhang. The source value remains on CurrentFrame.
Spacing EffectiveTilePadding [get]
 Gets oriented atlas padding for inspection, never for source slicing.
CollisionAdjust EffectiveCollisionAdjust [get]
 Gets the oriented collision insets, including the current frame-derived adjustment.
override Rectangle CollisionArea [get]
 Gets the collision area of this entity in world pixel coordinates.
override int ZOrder [get, set]
 Gets the z-order (rendering depth) of this tile within its layer.
override Rectangle DrawLocationWorld [get]
 Gets the world-space pixel rectangle where this tile should be drawn.
override bool IsPositionFixed [get]
 Gets a value indicating whether this tile's position is fixed within its grid.
override PointF SceneLayerCoordinates [get]
 Gets the grid coordinates of this tile within its parent scene layer as a floating-point value.
Point GridCoordinatesAbs [get]
 Gets the absolute grid coordinates of this tile within its parent scene layer as integer values.
override SceneLayer SceneLayer [get]
 Gets the parent scene layer that contains this tile.
bool EnableAnimator [get, set]
 Gets or sets a value indicating whether the tile's animator is enabled.
Properties inherited from Gondwana.Drawing.Tile
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.

Additional Inherited Members

Protected Member Functions inherited from Gondwana.Drawing.Tile
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 inherited from Gondwana.Drawing.Tile
bool pauseAnimation
 The pause animation.
ICollider? _collider
 The collider.

Detailed Description

Represents the values stored at a single location on a SceneLayer.

Definition at line 14 of file SceneLayerTile.cs.

Member Function Documentation

◆ Dispose()

override void Gondwana.Scenes.SceneLayerTile.Dispose ( )
virtual

Releases the resources owned by this instance.

Reimplemented from Gondwana.Drawing.Tile.

Definition at line 171 of file SceneLayerTile.cs.

◆ Draw()

override void Gondwana.Scenes.SceneLayerTile.Draw ( Gondwana.Rendering.Backbuffers.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.

Reimplemented from Gondwana.Drawing.Tile.

Definition at line 139 of file SceneLayerTile.cs.

Property Documentation

◆ CollisionArea

override Rectangle Gondwana.Scenes.SceneLayerTile.CollisionArea
get

Gets the collision area of this entity in world pixel coordinates.

Implements Gondwana.Physics.Collisions.ICollisionEntity.

Definition at line 136 of file SceneLayerTile.cs.

◆ DrawLocationWorld

override Rectangle Gondwana.Scenes.SceneLayerTile.DrawLocationWorld
get

Gets the world-space pixel rectangle where this tile should be drawn.

A Rectangle representing the tile's drawing bounds in world pixel coordinates, calculated by the parent layer's coordinate system and including any tile overhang.

This property uses the parent layer's coordinate system to transform the tile's grid coordinates into world-space pixel coordinates. The returned rectangle includes any overhang pixels defined by the tile's tilesheet, ensuring that tall or wide tiles (such as trees or buildings) are rendered with their full graphical extent.

The coordinate transformation depends on the layer's active coordinate system type (orthogonal, isometric, hexagonal, etc.) and accounts for the layer's tile size, origin offset, and other rendering properties.

Definition at line 227 of file SceneLayerTile.cs.

◆ EffectiveCollisionAdjust

CollisionAdjust Gondwana.Scenes.SceneLayerTile.EffectiveCollisionAdjust
get

Gets the oriented collision insets, including the current frame-derived adjustment.

Definition at line 132 of file SceneLayerTile.cs.

◆ EffectiveTilePadding

Spacing Gondwana.Scenes.SceneLayerTile.EffectiveTilePadding
get

Gets oriented atlas padding for inspection, never for source slicing.

Definition at line 128 of file SceneLayerTile.cs.

◆ EffectiveTileSize

Size Gondwana.Scenes.SceneLayerTile.EffectiveTileSize
get

Gets source frame dimensions after placement orientation.

Definition at line 120 of file SceneLayerTile.cs.

◆ EnableAnimator

bool Gondwana.Scenes.SceneLayerTile.EnableAnimator
getset

Gets or sets a value indicating whether the tile's animator is enabled.

true if the tile has an active Animator instance; otherwise, false.

Setting this property to true creates a new Animator instance for this tile if one doesn't already exist, enabling animation cycle playback. Setting it to false disposes the existing animator and stops any active animations.

The animator manages frame cycling for animated tiles, allowing tiles to display animated sequences defined by Cycle definitions. Animations are updated automatically during the engine's background update phase.

Creating animators adds overhead, so this property should only be set to true for tiles that require animation. Static tiles should keep this property as false.

Definition at line 336 of file SceneLayerTile.cs.

◆ EnableFog

override bool Gondwana.Scenes.SceneLayerTile.EnableFog
getset

Definition at line 83 of file SceneLayerTile.cs.

◆ GridCoordinatesAbs

Point Gondwana.Scenes.SceneLayerTile.GridCoordinatesAbs
get

Gets the absolute grid coordinates of this tile within its parent scene layer as integer values.

A Point representing the tile's exact column and row position in the layer's grid, where X is the column index and Y is the row index.

This property provides integer-based access to the tile's grid position, which is more appropriate for most tile-based operations than the floating-point SceneLayerCoordinates property. Grid coordinates are zero-based, with (0, 0) representing the top-left tile.

Use this property when you need exact grid indices for array access, adjacency checks, or other grid-based calculations that require integer precision.

Definition at line 291 of file SceneLayerTile.cs.

◆ IsPositionFixed

override bool Gondwana.Scenes.SceneLayerTile.IsPositionFixed
get

Gets a value indicating whether this tile's position is fixed within its grid.

Always returns true for scene layer tiles, indicating that they do not move independently from their assigned grid position.

Scene layer tiles are fundamentally different from sprites in that they occupy fixed positions within the layer's tile grid. While the entire layer can be scrolled, individual tiles cannot move to arbitrary positions. This property distinguishes tiles from sprites for rendering and collision detection purposes.

This property overrides Tile.IsPositionFixed to reflect the fixed nature of tiles within scene layers.

Definition at line 249 of file SceneLayerTile.cs.

◆ Overhang

override Spacing Gondwana.Scenes.SceneLayerTile.Overhang
get

Gets oriented overhang. The source value remains on CurrentFrame.

Definition at line 124 of file SceneLayerTile.cs.

◆ SceneLayer

override SceneLayer Gondwana.Scenes.SceneLayerTile.SceneLayer
get

Gets the parent scene layer that contains this tile.

The Gondwana.Scenes.SceneLayer instance that owns this tile.

This property provides access to the tile's parent layer, which is useful for accessing layer-level properties such as tile size, coordinate system, parallax settings, and other rendering parameters that affect how the tile is displayed.

Every scene layer tile is associated with exactly one parent layer, established when the layer is created. The relationship is immutable for the tile's lifetime.

Definition at line 311 of file SceneLayerTile.cs.

◆ SceneLayerCoordinates

override PointF Gondwana.Scenes.SceneLayerTile.SceneLayerCoordinates
get

Gets the grid coordinates of this tile within its parent scene layer as a floating-point value.

A PointF representing the tile's column and row position in the layer's grid, where X is the column index and Y is the row index.

This property returns the tile's position in grid space (column, row), not pixel space. Grid coordinates are zero-based, with (0, 0) representing the top-left tile of the layer.

For integer grid coordinates, use GridCoordinatesAbs instead. This property returns a PointF for compatibility with base class APIs that work with fractional coordinates.

Definition at line 270 of file SceneLayerTile.cs.

◆ Transform

TileTransform Gondwana.Scenes.SceneLayerTile.Transform
getset

Gets or sets this placement's orthogonal orientation without changing its source frame.

Definition at line 100 of file SceneLayerTile.cs.

◆ ZOrder

override int Gondwana.Scenes.SceneLayerTile.ZOrder
getset

Gets the z-order (rendering depth) of this tile within its layer.

An integer representing the tile's rendering priority. Lower values render first (behind), higher values render last (in front). For scene layer tiles, this is typically 0.

This property overrides the base Tile.ZOrder property with a new implementation that returns the tile's z-order for rendering within the scene layer. Z-order affects the rendering order when multiple drawable objects occupy overlapping positions.

Implements Gondwana.Drawing.IDrawable.

Definition at line 193 of file SceneLayerTile.cs.