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.Drawing.Animation.FrameSequence Struct Reference

Represents a sequence of animation frames that can be cycled through using different animation patterns. More...

Inheritance diagram for Gondwana.Drawing.Animation.FrameSequence:

Public Member Functions

double? GetDurationSeconds (int index)
 Gets the optional display duration for a frame occurrence.
void SetDurationSeconds (int index, double? seconds)
 Sets a positive display duration, or null to use the cycle default.
 FrameSequence (Frame frame)
 Initializes a new instance of the FrameSequence struct with a single frame.
 FrameSequence (List< Frame > frames)
 Initializes a new instance of the FrameSequence struct with a collection of frames.
Frame AddFrame (Tilesheet bmp, string regionName, int xTile, int yTile)
 Creates and adds a new frame to the sequence using tilesheet coordinates.
Frame AddFrame (Tilesheet bmp, int xTile, int yTile)
 Creates and adds a new frame to the sequence using tilesheet coordinates.
Frame AddFrame (Frame frame)
 Adds an existing frame to the sequence.
void RemoveFrame (int idx)
 Removes the frame at the specified index from the sequence.
void Reset ()
 Resets the sequence to its initial state, starting from the first frame.
IEnumerator GetEnumerator ()
 Returns an enumerator that iterates through the frame sequence.
IEnumerator< Frame > IEnumerable< Frame >. GetEnumerator ()
 Returns a strongly-typed enumerator that iterates through the frame sequence.

Public Attributes

CycleType SequenceCycleType
 The type of cycle pattern used when animating through the frame sequence.

Properties

bool CycleFinished [get]
 Gets a value indicating whether the animation cycle has finished playing through the sequence.
int FrameCount [get]
 Gets the total number of frames in the sequence.
Frame CurrentFrame [get]
 Gets the frame currently active in the animation sequence.
int CurrentFrameIdx [get]
 Gets the zero-based index of the current frame in the sequence.
IList< Frame > FrameList [get]
 Gets a read-only view of the list of frames in the sequence.
Frame this[int frameIdx] [get]
 Gets the frame at the specified index in the sequence.

Detailed Description

Represents a sequence of animation frames that can be cycled through using different animation patterns.

Definition at line 11 of file FrameSequence.cs.

Constructor & Destructor Documentation

◆ FrameSequence() [1/2]

Gondwana.Drawing.Animation.FrameSequence.FrameSequence ( Frame frame)

Initializes a new instance of the FrameSequence struct with a single frame.

Parameters
frameThe single frame to include in the sequence

Definition at line 67 of file FrameSequence.cs.

◆ FrameSequence() [2/2]

Gondwana.Drawing.Animation.FrameSequence.FrameSequence ( List< Frame > frames)

Initializes a new instance of the FrameSequence struct with a collection of frames.

Parameters
framesThe list of frames to include in the sequence

Definition at line 81 of file FrameSequence.cs.

Member Function Documentation

◆ AddFrame() [1/3]

Frame Gondwana.Drawing.Animation.FrameSequence.AddFrame ( Frame frame)

Adds an existing frame to the sequence.

Parameters
frameThe frame to add to the sequence
Returns
The added Frame

Definition at line 193 of file FrameSequence.cs.

◆ AddFrame() [2/3]

Frame Gondwana.Drawing.Animation.FrameSequence.AddFrame ( Tilesheet bmp,
int xTile,
int yTile )

Creates and adds a new frame to the sequence using tilesheet coordinates.

Parameters
bmpThe tilesheet containing the frame image
xTileThe x-coordinate of the tile in the tilesheet
yTileThe y-coordinate of the tile in the tilesheet
Returns
The newly created and added Frame

Definition at line 183 of file FrameSequence.cs.

◆ AddFrame() [3/3]

Frame Gondwana.Drawing.Animation.FrameSequence.AddFrame ( Tilesheet bmp,
string regionName,
int xTile,
int yTile )

Creates and adds a new frame to the sequence using tilesheet coordinates.

Parameters
bmpThe tilesheet containing the frame image
regionNameThe name of the region within the tilesheet
xTileThe x-coordinate of the tile in the tilesheet
yTileThe y-coordinate of the tile in the tilesheet
Returns
The newly created and added Frame

Definition at line 171 of file FrameSequence.cs.

◆ GetDurationSeconds()

double? Gondwana.Drawing.Animation.FrameSequence.GetDurationSeconds ( int index)

Gets the optional display duration for a frame occurrence.

Parameters
indexThe index.
Returns
The requested double, or null when unavailable.

◆ GetEnumerator() [1/2]

IEnumerator Gondwana.Drawing.Animation.FrameSequence.GetEnumerator ( )

Returns an enumerator that iterates through the frame sequence.

Returns
An IEnumerator for the frame sequence

Definition at line 314 of file FrameSequence.cs.

◆ GetEnumerator() [2/2]

IEnumerator< Frame > IEnumerable< Frame >. Gondwana.Drawing.Animation.FrameSequence.GetEnumerator ( )

Returns a strongly-typed enumerator that iterates through the frame sequence.

Returns
An IEnumerator<Frame> for the frame sequence

Definition at line 324 of file FrameSequence.cs.

◆ RemoveFrame()

void Gondwana.Drawing.Animation.FrameSequence.RemoveFrame ( int idx)

Removes the frame at the specified index from the sequence.

Parameters
idxThe zero-based index of the frame to remove

Definition at line 206 of file FrameSequence.cs.

◆ Reset()

void Gondwana.Drawing.Animation.FrameSequence.Reset ( )

Resets the sequence to its initial state, starting from the first frame.

Definition at line 222 of file FrameSequence.cs.

◆ SetDurationSeconds()

void Gondwana.Drawing.Animation.FrameSequence.SetDurationSeconds ( int index,
double? seconds )

Sets a positive display duration, or null to use the cycle default.

Parameters
indexThe index.
secondsThe seconds.

Definition at line 36 of file FrameSequence.cs.

Member Data Documentation

◆ SequenceCycleType

CycleType Gondwana.Drawing.Animation.FrameSequence.SequenceCycleType

The type of cycle pattern used when animating through the frame sequence.

Definition at line 19 of file FrameSequence.cs.

Property Documentation

◆ CurrentFrame

Frame Gondwana.Drawing.Animation.FrameSequence.CurrentFrame
get

Gets the frame currently active in the animation sequence.

Definition at line 130 of file FrameSequence.cs.

◆ CurrentFrameIdx

int Gondwana.Drawing.Animation.FrameSequence.CurrentFrameIdx
get

Gets the zero-based index of the current frame in the sequence.

Definition at line 145 of file FrameSequence.cs.

◆ CycleFinished

bool Gondwana.Drawing.Animation.FrameSequence.CycleFinished
get

Gets a value indicating whether the animation cycle has finished playing through the sequence.

Definition at line 106 of file FrameSequence.cs.

◆ FrameCount

int Gondwana.Drawing.Animation.FrameSequence.FrameCount
get

Gets the total number of frames in the sequence.

Definition at line 115 of file FrameSequence.cs.

◆ FrameList

IList<Frame> Gondwana.Drawing.Animation.FrameSequence.FrameList
get

Gets a read-only view of the list of frames in the sequence.

Definition at line 154 of file FrameSequence.cs.

◆ this[int frameIdx]

Frame Gondwana.Drawing.Animation.FrameSequence.this[int frameIdx]
get

Gets the frame at the specified index in the sequence.

Parameters
frameIdxThe zero-based index of the frame to retrieve
Returns
The Frame at the specified index

Definition at line 301 of file FrameSequence.cs.