C# Class SadConsole.Consoles.AnimatedTextSurface

Inheritance: TextSurface
Afficher le fichier Open project: Thraka/SadConsole Class Usage Examples

Méthodes publiques

Свойство Type Description
Frames List

Protected Properties

Свойство Type Description
_addedTime double
_animatedTime float
_currentFrameIndex int
_font Font
_isPlaying bool
_timePerFrame float
state AnimationState

Méthodes publiques

Méthode Description
AnimatedTextSurface ( string name, int width, int height ) : System

Creates a new animation with the specified name, width, and height.

AnimatedTextSurface ( string name, int width, int height, Font font ) : System

Creates a new animation with the specified name, width, and height.

CreateFrame ( ) : TextSurfaceBasic

Creates a new frame with the same dimensions as this entity and adds it to the Frames collection of the entity.

Load ( string file ) : AnimatedTextSurface

Loads an animated text surface from a file.

Restart ( ) : void

Restarts the animation from the first frame.

Save ( string file ) : void

Saves the animated text surface to a file.

Start ( ) : void

Starts animating the frames.

Stop ( ) : void

Stops animating.

ToString ( ) : string

Returns the name of the animation.

Update ( ) : void

Updates the animation frames based on the time passed since the last call to this method.

Méthodes protégées

Méthode Description
ResetArea ( ) : void

Forces the area of this text surface to always be the full width and height.

UpdateFrameReferences ( ) : void

Updates the base TextSurface render references to the current frame.

Private Methods

Méthode Description
CalculateFrameDuration ( ) : void

Calculates the time needed per frame for rendering.

Method Details

AnimatedTextSurface() public méthode

Creates a new animation with the specified name, width, and height.
public AnimatedTextSurface ( string name, int width, int height ) : System
name string The name of the animation.
width int The width of each frame this animation will have.
height int The height of each frame this animation will have.
Résultat System

AnimatedTextSurface() public méthode

Creates a new animation with the specified name, width, and height.
public AnimatedTextSurface ( string name, int width, int height, Font font ) : System
name string The name of the animation.
width int The width of each frame this animation will have.
height int The height of each frame this animation will have.
font Font The font used with this animation.
Résultat System

CreateFrame() public méthode

Creates a new frame with the same dimensions as this entity and adds it to the Frames collection of the entity.
public CreateFrame ( ) : TextSurfaceBasic
Résultat TextSurfaceBasic

Load() public static méthode

Loads an animated text surface from a file.
public static Load ( string file ) : AnimatedTextSurface
file string The source file.
Résultat AnimatedTextSurface

ResetArea() protected méthode

Forces the area of this text surface to always be the full width and height.
protected ResetArea ( ) : void
Résultat void

Restart() public méthode

Restarts the animation from the first frame.
public Restart ( ) : void
Résultat void

Save() public méthode

Saves the animated text surface to a file.
public Save ( string file ) : void
file string The destination file.
Résultat void

Start() public méthode

Starts animating the frames.
public Start ( ) : void
Résultat void

Stop() public méthode

Stops animating.
public Stop ( ) : void
Résultat void

ToString() public méthode

Returns the name of the animation.
public ToString ( ) : string
Résultat string

Update() public méthode

Updates the animation frames based on the time passed since the last call to this method.
public Update ( ) : void
Résultat void

UpdateFrameReferences() protected méthode

Updates the base TextSurface render references to the current frame.
protected UpdateFrameReferences ( ) : void
Résultat void

Property Details

Frames public_oe property

All frames of the animation
public List Frames
Résultat List

_addedTime protected_oe property

Time counter for the naimation
protected double _addedTime
Résultat double

_animatedTime protected_oe property

The length of the animation
protected float _animatedTime
Résultat float

_currentFrameIndex protected_oe property

The current frame index being animated.
protected int _currentFrameIndex
Résultat int

_font protected_oe property

The font to use with all frames.
protected Font _font
Résultat Font

_isPlaying protected_oe property

Indicates the animation is currently animating.
protected bool _isPlaying
Résultat bool

_timePerFrame protected_oe property

How much time per animated frame should be used.
protected float _timePerFrame
Résultat float

state protected_oe property

The state of the animation.
protected AnimationState state
Résultat AnimationState