![]() |
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.
|
Manages the lifecycle, lookup, and per-frame updates of all active Sprite instances. More...
Public Member Functions | |
| Sprite | CreateSprite (SceneLayer sceneLayer, Frame frame, string? id=null, string? collisionProfileName=null) |
| Creates a new sprite on the specified scene layer with the given frame. | |
| Sprite | CloneSprite (Sprite sprite) |
| Creates a copy of the specified sprite, preserving its current scene layer. | |
| Sprite | CloneSprite (Sprite sprite, SceneLayer sceneLayer) |
| Creates a clone of the specified sprite on the given scene layer. | |
| Sprite? | CloneSprite (string id, SceneLayer sceneLayer) |
| Creates a clone of the sprite with the specified ID on the given scene layer. | |
| void | Remove (Sprite sprite) |
| Removes and disposes the specified sprite. | |
| void | Remove (string ID) |
| Removes and disposes the sprite with the specified ID. | |
| void | Clear () |
| Removes and disposes all sprites currently managed by the sprite manager. | |
| Sprite? | GetSpriteByID (string ID) |
| Retrieves a sprite by its ID/nickname. | |
| List< Sprite > | GetSpritesInWorldRectRange (Rectangle worldRect, SceneLayer? sceneLayer=null, bool fullEnclosures=false) |
| Gets all sprites within the specified world rectangle range. | |
| List< Sprite > | GetSpritesInViewRectRange (View view, Rectangle viewRectPx, SceneLayer? sceneLayer=null, bool fullEnclosures=false) |
| Gets all sprites within the specified view rectangle range. | |
| List< Sprite > | GetSpritesAtViewPixel (View view, Point viewPxlPt, SceneLayer? sceneLayer=null) |
| Gets all sprites at the specified view pixel coordinate. | |
| void | Dispose () |
| Releases all sprites currently managed by this instance. | |
Properties | |
| static SpriteManager | Instance [get] |
| Gets the singleton instance of the sprite manager. | |
| ReadOnlyCollection< Sprite > | AllSprites [get] |
| Gets a read-only collection of all sprites currently managed by the sprite manager. | |
| bool | SizeNewSpritesToSceneLayer = true [get, set] |
| Gets or sets a value indicating whether new sprites should be automatically sized to their scene layer. | |
| string | DefaultCollisionProfile [get, set] |
| Gets or sets the scene collision profile assigned to newly created sprites when no profile is specified explicitly. | |
Events | |
| Action< Sprite >? | SpriteCreated |
| Event raised when a new sprite is created. | |
Manages the lifecycle, lookup, and per-frame updates of all active Sprite instances.
Definition at line 14 of file SpriteManager.cs.
| void Gondwana.Drawing.Sprites.SpriteManager.Clear | ( | ) |
Removes and disposes all sprites currently managed by the sprite manager.
Definition at line 161 of file SpriteManager.cs.
Creates a copy of the specified sprite, preserving its current scene layer.
| sprite | The sprite to clone. Cannot be null. |
| Sprite Gondwana.Drawing.Sprites.SpriteManager.CloneSprite | ( | Sprite | sprite, |
| SceneLayer | sceneLayer ) |
Creates a clone of the specified sprite on the given scene layer.
| sprite | The sprite to clone. |
| sceneLayer | The scene layer for the cloned sprite. |
Definition at line 114 of file SpriteManager.cs.
| Sprite? Gondwana.Drawing.Sprites.SpriteManager.CloneSprite | ( | string | id, |
| SceneLayer | sceneLayer ) |
Creates a clone of the sprite with the specified ID on the given scene layer.
| id | The ID/nickname of the sprite to clone. |
| sceneLayer | The scene layer for the cloned sprite. |
Definition at line 128 of file SpriteManager.cs.
| Sprite Gondwana.Drawing.Sprites.SpriteManager.CreateSprite | ( | SceneLayer | sceneLayer, |
| Frame | frame, | ||
| string? | id = null, | ||
| string? | collisionProfileName = null ) |
Creates a new sprite on the specified scene layer with the given frame.
| sceneLayer | The scene layer on which to create the sprite. |
| frame | The frame to use for the sprite. |
| id | Optional nickname/identifier for the sprite. |
| collisionProfileName | Optional scene collision profile. When omitted, DefaultCollisionProfile is used. |
Definition at line 85 of file SpriteManager.cs.
| void Gondwana.Drawing.Sprites.SpriteManager.Dispose | ( | ) |
Releases all sprites currently managed by this instance.
Definition at line 424 of file SpriteManager.cs.
| Sprite? Gondwana.Drawing.Sprites.SpriteManager.GetSpriteByID | ( | string | ID | ) |
Retrieves a sprite by its ID/nickname.
| ID | The ID/nickname of the sprite to retrieve. |
Definition at line 176 of file SpriteManager.cs.
| List< Sprite > Gondwana.Drawing.Sprites.SpriteManager.GetSpritesAtViewPixel | ( | View | view, |
| Point | viewPxlPt, | ||
| SceneLayer? | sceneLayer = null ) |
Gets all sprites at the specified view pixel coordinate.
| view | The view to use for coordinate transformation. |
| viewPxlPt | The pixel coordinate in the view to check. |
| sceneLayer | Optional scene layer to filter by. If null, searches all layers. |
Definition at line 301 of file SpriteManager.cs.
| List< Sprite > Gondwana.Drawing.Sprites.SpriteManager.GetSpritesInViewRectRange | ( | View | view, |
| Rectangle | viewRectPx, | ||
| SceneLayer? | sceneLayer = null, | ||
| bool | fullEnclosures = false ) |
Gets all sprites within the specified view rectangle range.
| view | The view to use for coordinate transformation. |
| viewRectPx | The view rectangle in pixels to search within. |
| sceneLayer | Optional scene layer to filter by. If null, searches all layers. |
| fullEnclosures | If true, only returns sprites fully contained within the rectangle. If false, returns sprites that intersect with the rectangle. |
Definition at line 260 of file SpriteManager.cs.
| List< Sprite > Gondwana.Drawing.Sprites.SpriteManager.GetSpritesInWorldRectRange | ( | Rectangle | worldRect, |
| SceneLayer? | sceneLayer = null, | ||
| bool | fullEnclosures = false ) |
Gets all sprites within the specified world rectangle range.
| worldRect | The world rectangle to search within. |
| sceneLayer | Optional scene layer to filter by. If null, searches all layers. |
| fullEnclosures | If true, only returns sprites fully contained within the rectangle. If false, returns sprites that intersect with the rectangle. |
Definition at line 220 of file SpriteManager.cs.
| void Gondwana.Drawing.Sprites.SpriteManager.Remove | ( | Sprite | sprite | ) |
Removes and disposes the specified sprite.
| sprite | The sprite to remove. |
Definition at line 142 of file SpriteManager.cs.
| void Gondwana.Drawing.Sprites.SpriteManager.Remove | ( | string | ID | ) |
Removes and disposes the sprite with the specified ID.
| ID | The ID/nickname of the sprite to remove. |
Definition at line 151 of file SpriteManager.cs.
|
get |
Gets a read-only collection of all sprites currently managed by the sprite manager.
Definition at line 42 of file SpriteManager.cs.
|
getset |
Gets or sets the scene collision profile assigned to newly created sprites when no profile is specified explicitly.
Definition at line 62 of file SpriteManager.cs.
|
staticget |
Gets the singleton instance of the sprite manager.
The shared SpriteManager instance.
Definition at line 25 of file SpriteManager.cs.
|
getset |
Gets or sets a value indicating whether new sprites should be automatically sized to their scene layer.
Definition at line 54 of file SpriteManager.cs.
| Action<Sprite>? Gondwana.Drawing.Sprites.SpriteManager.SpriteCreated |
Event raised when a new sprite is created.
Definition at line 35 of file SpriteManager.cs.