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.
Loading...
Searching...
No Matches
Gondwana.Drawing.Direct.DirectComposite Class Reference
Inheritance diagram for Gondwana.Drawing.Direct.DirectComposite:
Gondwana.Drawing.Direct.IDirectDrawable Gondwana.Movement.IMovable Gondwana.Drawing.IDrawable

Public Member Functions

 DirectComposite (RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, PointF anchor=default, string? nickname=null)
DirectComposite Add (DirectDrawingMovableBase child, bool keepCurrentOffset=true, Vector2? explicitLocalOffsetPx=null)
 Adds a child and stores its local pixel offset from the composite anchor. If keepCurrentOffset is true (default), the offset is computed from the child's current Bounds. Otherwise, pass an explicit local pixel offset.
DirectComposite Remove (DirectDrawingMovableBase child)
DirectComposite Clear ()
DirectComposite SetLocalOffset (DirectDrawingMovableBase child, Vector2 newLocalOffsetPx)
 Change a specific child's local pixel offset and re-apply its absolute position.
DirectComposite SetPosition (float x, float y)
 Set the composite anchor in pixels and reposition all children from their stored local offsets.
Vector2 GetPosition ()
 Get the current position in the mover's PositionSpace.
void SetPosition (Vector2 pos)
 Set the position in the mover's PositionSpace.
RectangleF GetDrawLocationScreen (View view)
 Computes the object's destination rectangle in SCREEN pixels for rendering on the Backbuffer, using the provided View to project from world-space.
void Draw (BackbufferBase backbuffer, RectangleF destRectScreen)
 Draws the object to the Backbuffer using the provided SCREEN-space destination rectangle. The rectangle is assumed to already be projected into screen-space; no world-to-screen conversion should occur within this method.
void Update (long tick)
 Updates the state of the object based on the specified tick value.
DirectComposite SetZOrder (int z)
DirectComposite SetOpacity (float opacity)
DirectComposite FadeTo (float targetOpacity, float durationSec)
DirectComposite FadeIn (float durationSec)
DirectComposite FadeOut (float durationSec)
DirectComposite SetIsVisible (bool visible)
void Dispose ()

Properties

RenderSurfaceHostBase RenderSurfaceHost [get]
 The rendering surface to which this drawable belongs.
ReadOnlyCollection< DirectDrawingMovableBaseChildren [get]
MovementController Movement [get]
MovementSpace PositionSpace [get]
 Which unit system this mover uses for its position.
Guid Id = Guid.NewGuid() [get]
 Auto-assigned unique identifier for the object.
string? Nickname [get]
 Optional human-readable name associated with the object.
bool Visible [get, set]
 Returns true if any child is visible; setting this sets all children's Visible to the same value.
int ZOrder [get]
 Gets the z-order of the element, which determines its visual stacking order relative to other elements. Higher z-order values are drawn on top of lower ones.
Rectangle ScreenBounds [get]
 The bounding rectangle of this drawable in SCREEN space.
Rectangle WorldBounds [get]
 The bounding rectangle of this drawable in WORLD space.
DirectDrawingMode Mode [get]
 Gets the drawing mode that determines where and how this drawable is rendered.

Events

EventHandler< IDirectDrawable >? Disposing
Events inherited from Gondwana.Drawing.Direct.IDirectDrawable
EventHandler< IDirectDrawable >? Disposing
 Occurs when the object is being disposed.

Constructor & Destructor Documentation

◆ DirectComposite()

Gondwana.Drawing.Direct.DirectComposite.DirectComposite ( RenderSurfaceHostBase renderSurfaceHost,
DirectDrawingMode mode,
PointF anchor = default,
string? nickname = null )

Member Function Documentation

◆ Add()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.Add ( DirectDrawingMovableBase child,
bool keepCurrentOffset = true,
Vector2? explicitLocalOffsetPx = null )

Adds a child and stores its local pixel offset from the composite anchor. If keepCurrentOffset is true (default), the offset is computed from the child's current Bounds. Otherwise, pass an explicit local pixel offset.

◆ Clear()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.Clear ( )

◆ Dispose()

void Gondwana.Drawing.Direct.DirectComposite.Dispose ( )

◆ Draw()

void Gondwana.Drawing.Direct.DirectComposite.Draw ( BackbufferBase backbuffer,
RectangleF destRectScreen )

Draws the object to the Backbuffer using the provided SCREEN-space destination rectangle. The rectangle is assumed to already be projected into screen-space; no world-to-screen conversion should occur within this method.

Parameters
backbufferThe Backbuffer to draw onto.
destRectScreenThe destination rectangle in absolute SCREEN pixel coordinates on the Backbuffer.

Implements Gondwana.Drawing.IDrawable.

◆ FadeIn()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.FadeIn ( float durationSec)

◆ FadeOut()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.FadeOut ( float durationSec)

◆ FadeTo()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.FadeTo ( float targetOpacity,
float durationSec )

◆ GetDrawLocationScreen()

RectangleF Gondwana.Drawing.Direct.DirectComposite.GetDrawLocationScreen ( View view)

Computes the object's destination rectangle in SCREEN pixels for rendering on the Backbuffer, using the provided View to project from world-space.

Parameters
viewThe View providing camera, zoom, parallax, and viewport offsets used to convert the object's world-space bounds into screen-space.
Returns
A rectangle in absolute SCREEN pixel coordinates on the Backbuffer.

Implements Gondwana.Drawing.IDrawable.

◆ GetPosition()

Vector2 Gondwana.Drawing.Direct.DirectComposite.GetPosition ( )

Get the current position in the mover's PositionSpace.

Implements Gondwana.Movement.IMovable.

◆ Remove()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.Remove ( DirectDrawingMovableBase child)

◆ SetIsVisible()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.SetIsVisible ( bool visible)

◆ SetLocalOffset()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.SetLocalOffset ( DirectDrawingMovableBase child,
Vector2 newLocalOffsetPx )

Change a specific child's local pixel offset and re-apply its absolute position.

◆ SetOpacity()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.SetOpacity ( float opacity)

◆ SetPosition() [1/2]

DirectComposite Gondwana.Drawing.Direct.DirectComposite.SetPosition ( float x,
float y )

Set the composite anchor in pixels and reposition all children from their stored local offsets.

◆ SetPosition() [2/2]

void Gondwana.Drawing.Direct.DirectComposite.SetPosition ( Vector2 pos)

Set the position in the mover's PositionSpace.

Implements Gondwana.Movement.IMovable.

◆ SetZOrder()

DirectComposite Gondwana.Drawing.Direct.DirectComposite.SetZOrder ( int z)

◆ Update()

void Gondwana.Drawing.Direct.DirectComposite.Update ( long tick)

Updates the state of the object based on the specified tick value.

Parameters
tickThe current tick value from Engine.Cycle().

Implements Gondwana.Drawing.Direct.IDirectDrawable.

Property Documentation

◆ Children

ReadOnlyCollection<DirectDrawingMovableBase> Gondwana.Drawing.Direct.DirectComposite.Children
get

◆ Id

Guid Gondwana.Drawing.Direct.DirectComposite.Id = Guid.NewGuid()
get

Auto-assigned unique identifier for the object.

Implements Gondwana.Drawing.IDrawable.

◆ Mode

DirectDrawingMode Gondwana.Drawing.Direct.DirectComposite.Mode
get

Gets the drawing mode that determines where and how this drawable is rendered.

The drawing mode defines the coordinate space and rendering lifecycle:

  • DirectDrawingMode.SceneLayer Renders in world space as part of a scene layer and is affected by camera position, zoom, and parallax.
  • DirectDrawingMode.View Renders in screen space at the view level and is independent of camera movement, making it suitable for UI, overlays, and debug visuals.

Implements Gondwana.Drawing.Direct.IDirectDrawable.

◆ Movement

MovementController Gondwana.Drawing.Direct.DirectComposite.Movement
get

◆ Nickname

string? Gondwana.Drawing.Direct.DirectComposite.Nickname
get

Optional human-readable name associated with the object.

Implements Gondwana.Drawing.IDrawable.

◆ PositionSpace

MovementSpace Gondwana.Drawing.Direct.DirectComposite.PositionSpace
get

Which unit system this mover uses for its position.

Implements Gondwana.Movement.IMovable.

◆ RenderSurfaceHost

RenderSurfaceHostBase Gondwana.Drawing.Direct.DirectComposite.RenderSurfaceHost
get

The rendering surface to which this drawable belongs.

Implements Gondwana.Drawing.Direct.IDirectDrawable.

◆ ScreenBounds

Rectangle Gondwana.Drawing.Direct.DirectComposite.ScreenBounds
get

The bounding rectangle of this drawable in SCREEN space.

Implements Gondwana.Drawing.Direct.IDirectDrawable.

◆ Visible

bool Gondwana.Drawing.Direct.DirectComposite.Visible
getset

Returns true if any child is visible; setting this sets all children's Visible to the same value.

Implements Gondwana.Drawing.IDrawable.

◆ WorldBounds

Rectangle Gondwana.Drawing.Direct.DirectComposite.WorldBounds
get

The bounding rectangle of this drawable in WORLD space.

Implements Gondwana.Drawing.Direct.IDirectDrawable.

◆ ZOrder

int Gondwana.Drawing.Direct.DirectComposite.ZOrder
get

Gets the z-order of the element, which determines its visual stacking order relative to other elements. Higher z-order values are drawn on top of lower ones.

Implements Gondwana.Drawing.IDrawable.

Event Documentation

◆ Disposing

EventHandler<IDirectDrawable>? Gondwana.Drawing.Direct.DirectComposite.Disposing