C# Class SadConsole.Consoles.AnimatedTextSurface

Inheritance: TextSurface
ファイルを表示 Open project: Thraka/SadConsole Class Usage Examples

Public Properties

Property Type Description
Frames List

Protected Properties

Property Type Description
_addedTime double
_animatedTime float
_currentFrameIndex int
_font Font
_isPlaying bool
_timePerFrame float
state AnimationState

Public Methods

Method 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.

Protected Methods

Method 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

Method Description
CalculateFrameDuration ( ) : void

Calculates the time needed per frame for rendering.

Method Details

AnimatedTextSurface() public method

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.
return System

AnimatedTextSurface() public method

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.
return System

CreateFrame() public method

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

Load() public static method

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

ResetArea() protected method

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

Restart() public method

Restarts the animation from the first frame.
public Restart ( ) : void
return void

Save() public method

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

Start() public method

Starts animating the frames.
public Start ( ) : void
return void

Stop() public method

Stops animating.
public Stop ( ) : void
return void

ToString() public method

Returns the name of the animation.
public ToString ( ) : string
return string

Update() public method

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

UpdateFrameReferences() protected method

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

Property Details

Frames public_oe property

All frames of the animation
public List Frames
return List

_addedTime protected_oe property

Time counter for the naimation
protected double _addedTime
return double

_animatedTime protected_oe property

The length of the animation
protected float _animatedTime
return float

_currentFrameIndex protected_oe property

The current frame index being animated.
protected int _currentFrameIndex
return int

_font protected_oe property

The font to use with all frames.
protected Font _font
return Font

_isPlaying protected_oe property

Indicates the animation is currently animating.
protected bool _isPlaying
return bool

_timePerFrame protected_oe property

How much time per animated frame should be used.
protected float _timePerFrame
return float

state protected_oe property

The state of the animation.
protected AnimationState state
return AnimationState