![]() |
Gondwana Game Engine
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, mobile, and web platforms using SkiaSharp for graphics and NAudio for sound.
|
Represents a composite sprite that contains multiple child sprites and manages them as a single unit. All child sprites must belong to the same SceneLayer. More...
Public Member Functions | |
| CompositeSprite () | |
| Initializes a new instance of the CompositeSprite class. | |
| CompositeSprite (List< Sprite > sprites) | |
| Initializes a new instance of the CompositeSprite class with the specified list of sprites. | |
| CompositeSprite (params Sprite[] sprites) | |
| Initializes a new instance of the CompositeSprite class with the specified array of sprites. | |
| Vector2 | GetPosition () |
| Gets the current position of the composite sprite based on its anchor mode. | |
| void | SetPosition (Vector2 pos) |
| Sets the position of the composite sprite by moving all child sprites to maintain their relative positions. | |
| void | Translate (Vector2 delta) |
| Translates the composite sprite by the specified delta vector. | |
| void | Add (Sprite sprite) |
| Adds an existing sprite at its current position (no reposition). | |
| void | AddChildAtPosition (Sprite sprite, Vector2 absolutePosition) |
| Add a sprite and place it at an absolute position (in the composite's PositionSpace). | |
| void | AddChildWithOffset (Sprite sprite, Vector2 offsetFromCompositeAnchor) |
| Add a sprite and place it by offset from the composite anchor. Offset is interpreted relative to the CURRENT composite anchor (derived from Range). | |
| void | Remove (Sprite sprite) |
| Removes a sprite from this composite. | |
Properties | |
| CompositeAnchorMode | AnchorMode = CompositeAnchorMode.TopLeft [get, set] |
| Gets or sets the anchor mode that determines how the composite's position is calculated relative to its children. | |
| MovementSpace | PositionSpace [get] |
| Gets the movement space used for positioning this composite sprite. | |
| SceneLayer | SceneLayer [get] |
| Gets the scene layer that all child sprites belong to. | |
| ReadOnlyCollection< Sprite > | Children [get] |
| Gets a read-only collection of all child sprites in this composite. | |
| Rectangle | Range [get] |
| Gets the bounding rectangle that encompasses all child sprites. Returns Rectangle.Empty if there are no children. | |
Represents a composite sprite that contains multiple child sprites and manages them as a single unit. All child sprites must belong to the same SceneLayer.
| Gondwana.Drawing.Sprites.CompositeSprite.CompositeSprite | ( | ) |
Initializes a new instance of the CompositeSprite class.
| Gondwana.Drawing.Sprites.CompositeSprite.CompositeSprite | ( | List< Sprite > | sprites | ) |
Initializes a new instance of the CompositeSprite class with the specified list of sprites.
| sprites | The list of sprites to add to this composite. |
| Gondwana.Drawing.Sprites.CompositeSprite.CompositeSprite | ( | params Sprite[] | sprites | ) |
Initializes a new instance of the CompositeSprite class with the specified array of sprites.
| sprites | The array of sprites to add to this composite. |
| void Gondwana.Drawing.Sprites.CompositeSprite.Add | ( | Sprite | sprite | ) |
Adds an existing sprite at its current position (no reposition).
| sprite | The sprite to add to this composite. |
| ArgumentNullException | Thrown when sprite is null. |
| InvalidOperationException | Thrown when the sprite belongs to a different SceneLayer than existing children. |
| void Gondwana.Drawing.Sprites.CompositeSprite.AddChildAtPosition | ( | Sprite | sprite, |
| Vector2 | absolutePosition ) |
Add a sprite and place it at an absolute position (in the composite's PositionSpace).
| sprite | The sprite to add to this composite. |
| absolutePosition | The absolute position to place the sprite at. |
| ArgumentNullException | Thrown when sprite is null. |
| InvalidOperationException | Thrown when the sprite belongs to a different SceneLayer than existing children. |
| void Gondwana.Drawing.Sprites.CompositeSprite.AddChildWithOffset | ( | Sprite | sprite, |
| Vector2 | offsetFromCompositeAnchor ) |
Add a sprite and place it by offset from the composite anchor. Offset is interpreted relative to the CURRENT composite anchor (derived from Range).
| sprite | The sprite to add to this composite. |
| offsetFromCompositeAnchor | The offset from the composite's anchor point. |
| ArgumentNullException | Thrown when sprite is null. |
| InvalidOperationException | Thrown when the sprite belongs to a different SceneLayer than existing children. |
| Vector2 Gondwana.Drawing.Sprites.CompositeSprite.GetPosition | ( | ) |
Gets the current position of the composite sprite based on its anchor mode.
Implements Gondwana.Movement.IMovable.
| void Gondwana.Drawing.Sprites.CompositeSprite.Remove | ( | Sprite | sprite | ) |
Removes a sprite from this composite.
| sprite | The sprite to remove. |
| void Gondwana.Drawing.Sprites.CompositeSprite.SetPosition | ( | Vector2 | pos | ) |
Sets the position of the composite sprite by moving all child sprites to maintain their relative positions.
| pos | The new position for the composite's anchor point. |
Implements Gondwana.Movement.IMovable.
| void Gondwana.Drawing.Sprites.CompositeSprite.Translate | ( | Vector2 | delta | ) |
Translates the composite sprite by the specified delta vector.
| delta | The translation vector to apply. |
|
getset |
Gets or sets the anchor mode that determines how the composite's position is calculated relative to its children.
|
get |
Gets a read-only collection of all child sprites in this composite.
|
get |
Gets the movement space used for positioning this composite sprite.
Implements Gondwana.Movement.IMovable.
|
get |
Gets the bounding rectangle that encompasses all child sprites. Returns Rectangle.Empty if there are no children.
|
get |
Gets the scene layer that all child sprites belong to.
| InvalidOperationException | Thrown when the composite has no children. |
Implements Gondwana.Movement.IMovableOnSceneLayer.