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...
|
| virtual RectangleF | GetDrawLocationScreen (View view) |
| | Converts the tile's world location to screen coordinates based on the specified view.
|
| virtual RectangleF | GetCollisionAreaScreen (View view) |
| | Converts the tile's collision area from world coordinates to screen coordinates.
|
| virtual void | Draw (BackbufferBase backbuffer, RectangleF destRectScreen) |
| | Renders the tile to the specified backbuffer at the given screen location.
|
| int | CompareTo (Tile? tile) |
| | Compares this tile to another tile for sorting purposes. Fixed-position tiles are rendered first, followed by tiles sorted by Y-coordinate, Z-order, and X-coordinate.
|
| virtual void | Dispose () |
| | Releases all resources used by the tile, including removing it from animation tracking, disposing its animator, and clearing collision references.
|
|
| static List< Tile > | TilesAnimating = new() [get] |
| | Gets the collection of all tiles that are currently animating in the scene. Used to track and update animated tiles during the render cycle.
|
| bool | IsPositionFixed [get] |
| | Gets a value indicating whether the tile's position is fixed in screen space (e.g., UI elements) or moves with the world (e.g., game objects).
|
| Rectangle | DrawLocationWorld [get] |
| | Gets the tile's draw location in world coordinates as a rectangle. This represents the area occupied by the tile in the game world.
|
| PointF | SceneLayerCoordinates [get] |
| | Gets the tile's position within its scene layer using the layer's coordinate system.
|
| SceneLayer | SceneLayer [get] |
| | Gets the scene layer that contains this tile.
|
| Guid | Id = Guid.NewGuid() [get] |
| | Gets the unique identifier for this tile instance.
|
| string? | Nickname [get, set] |
| | Gets or sets an optional friendly name for the tile, useful for debugging and identification.
|
| virtual bool | Visible [get, set] |
| | Gets or sets a value indicating whether the tile is visible and should be rendered. Setting this property triggers a refresh of the tile's screen area.
|
| virtual int | ZOrder [get, set] |
| | Gets or sets the Z-order (depth) of the tile for rendering priority. Higher values are drawn later (on top of lower values). Setting this property triggers a refresh of the tile's screen area.
|
| virtual Overhang | OverhangPixels [get] |
| | Gets the overhang dimensions (in pixels) that extend beyond the tile's primary area. This is typically used for tiles with visual elements that exceed their logical boundaries.
|
| virtual Frame | CurrentFrame [get, set] |
| | Gets or sets the current frame being displayed for this tile. Setting this property triggers a refresh of both the old and new tile areas to handle size changes.
|
| virtual Animator | TileAnimator [get] |
| | Gets the animator responsible for managing frame transitions and animation sequences for this tile.
|
| virtual bool | PauseAnimation [get, set] |
| | Gets or sets a value indicating whether the tile's animation is currently paused.
|
| virtual ? ICollider | Collider [get] |
| | Gets the collider used for collision detection with this tile. Returns null if the tile has no collision detection.
|
| virtual Rectangle | CollisionArea [get] |
| | Gets the effective collision area of the tile in world coordinates, incorporating any adjustments specified by AdjustCollisionArea.
|
| virtual bool | EnableFog [get, set] |
| | Gets or sets a value indicating whether fog of war rendering is enabled for this tile. Setting this property triggers a refresh of the tile's screen area.
|
| virtual Point[] | OutlinePointsWorld [get] |
| | Used to determine polygonal area when drawing grid lines or fog. Override this property in a derived class to define custom areas for these effects.
|
| virtual CollisionDetectionAdjustment | AdjustCollisionArea = CollisionDetectionAdjustment.None [get, set] |
| | Gets or sets the collision area adjustment values that modify the tile's collision boundaries. Use this to fine-tune the collision detection area relative to the tile's visual bounds.
|
| TypedValueBag | ValueBag = new() [get] |
| | Gets the value bag for storing arbitrary typed values associated with this tile. Useful for attaching custom game-specific data without subclassing.
|
Represents an abstract base class for drawable tiles in the Gondwana engine. Provides core functionality for rendering, animation, collision detection, and scene layer integration.
◆ CompareTo()
| int Gondwana.Drawing.Tile.CompareTo |
( |
Tile? | tile | ) |
|
Compares this tile to another tile for sorting purposes. Fixed-position tiles are rendered first, followed by tiles sorted by Y-coordinate, Z-order, and X-coordinate.
- Parameters
-
| tile | The tile to compare with this instance. |
- Returns
- A negative value if this tile should be drawn before the other tile, zero if they have the same draw order, or a positive value if this tile should be drawn after the other tile.
◆ Dispose()
| virtual void Gondwana.Drawing.Tile.Dispose |
( |
| ) |
|
|
virtual |
Releases all resources used by the tile, including removing it from animation tracking, disposing its animator, and clearing collision references.
Reimplemented in Gondwana.Drawing.Sprites.Sprite.
◆ Draw()
| virtual void Gondwana.Drawing.Tile.Draw |
( |
BackbufferBase | backbuffer, |
|
|
RectangleF | destRectScreen ) |
|
virtual |
Renders the tile to the specified backbuffer at the given screen location.
- Parameters
-
| backbuffer | The backbuffer to render to. |
| destRectScreen | The destination rectangle in screen coordinates where the tile should be drawn. |
Implements Gondwana.Drawing.IDrawable.
◆ GetCollisionAreaScreen()
| virtual RectangleF Gondwana.Drawing.Tile.GetCollisionAreaScreen |
( |
View | view | ) |
|
|
virtual |
Converts the tile's collision area from world coordinates to screen coordinates.
- Parameters
-
| view | The view containing camera and viewport information for the transformation. |
- Returns
- The tile's collision area in screen space as a rectangle.
◆ GetDrawLocationScreen()
| virtual RectangleF Gondwana.Drawing.Tile.GetDrawLocationScreen |
( |
View | view | ) |
|
|
virtual |
Converts the tile's world location to screen coordinates based on the specified view.
- Parameters
-
| view | The view containing camera and viewport information for the transformation. |
- Returns
- The tile's location in screen space as a rectangle.
Implements Gondwana.Drawing.IDrawable.
◆ _collider
◆ pauseAnimation
| bool Gondwana.Drawing.Tile.pauseAnimation |
|
protected |
◆ AdjustCollisionArea
Gets or sets the collision area adjustment values that modify the tile's collision boundaries. Use this to fine-tune the collision detection area relative to the tile's visual bounds.
◆ Collider
| virtual ? ICollider Gondwana.Drawing.Tile.Collider |
|
get |
Gets the collider used for collision detection with this tile. Returns null if the tile has no collision detection.
◆ CollisionArea
| virtual Rectangle Gondwana.Drawing.Tile.CollisionArea |
|
get |
Gets the effective collision area of the tile in world coordinates, incorporating any adjustments specified by AdjustCollisionArea.
◆ CurrentFrame
| virtual Frame Gondwana.Drawing.Tile.CurrentFrame |
|
getset |
Gets or sets the current frame being displayed for this tile. Setting this property triggers a refresh of both the old and new tile areas to handle size changes.
◆ DrawLocationWorld
| Rectangle Gondwana.Drawing.Tile.DrawLocationWorld |
|
getabstract |
Gets the tile's draw location in world coordinates as a rectangle. This represents the area occupied by the tile in the game world.
◆ EnableFog
| virtual bool Gondwana.Drawing.Tile.EnableFog |
|
getset |
Gets or sets a value indicating whether fog of war rendering is enabled for this tile. Setting this property triggers a refresh of the tile's screen area.
◆ Id
| Guid Gondwana.Drawing.Tile.Id = Guid.NewGuid() |
|
get |
◆ IsPositionFixed
| bool Gondwana.Drawing.Tile.IsPositionFixed |
|
getabstract |
Gets a value indicating whether the tile's position is fixed in screen space (e.g., UI elements) or moves with the world (e.g., game objects).
◆ Nickname
| string? Gondwana.Drawing.Tile.Nickname |
|
getset |
Gets or sets an optional friendly name for the tile, useful for debugging and identification.
Implements Gondwana.Drawing.IDrawable.
◆ OutlinePointsWorld
| virtual Point [] Gondwana.Drawing.Tile.OutlinePointsWorld |
|
get |
Used to determine polygonal area when drawing grid lines or fog. Override this property in a derived class to define custom areas for these effects.
◆ OverhangPixels
| virtual Overhang Gondwana.Drawing.Tile.OverhangPixels |
|
get |
Gets the overhang dimensions (in pixels) that extend beyond the tile's primary area. This is typically used for tiles with visual elements that exceed their logical boundaries.
◆ PauseAnimation
| virtual bool Gondwana.Drawing.Tile.PauseAnimation |
|
getset |
Gets or sets a value indicating whether the tile's animation is currently paused.
◆ SceneLayer
Gets the scene layer that contains this tile.
◆ SceneLayerCoordinates
| PointF Gondwana.Drawing.Tile.SceneLayerCoordinates |
|
getabstract |
Gets the tile's position within its scene layer using the layer's coordinate system.
◆ TileAnimator
| virtual Animator Gondwana.Drawing.Tile.TileAnimator |
|
get |
Gets the animator responsible for managing frame transitions and animation sequences for this tile.
◆ TilesAnimating
| List<Tile> Gondwana.Drawing.Tile.TilesAnimating = new() |
|
staticget |
Gets the collection of all tiles that are currently animating in the scene. Used to track and update animated tiles during the render cycle.
◆ ValueBag
Gets the value bag for storing arbitrary typed values associated with this tile. Useful for attaching custom game-specific data without subclassing.
◆ Visible
| virtual bool Gondwana.Drawing.Tile.Visible |
|
getset |
Gets or sets a value indicating whether the tile is visible and should be rendered. Setting this property triggers a refresh of the tile's screen area.
Implements Gondwana.Drawing.IDrawable.
◆ ZOrder
| virtual int Gondwana.Drawing.Tile.ZOrder |
|
getset |
Gets or sets the Z-order (depth) of the tile for rendering priority. Higher values are drawn later (on top of lower values). Setting this property triggers a refresh of the tile's screen area.
Implements Gondwana.Drawing.IDrawable.