Public Member Functions | |
| Sprite (int width, int height) | |
| Constructs a Sprite object, of the specified width and height. | |
| Sprite (Size size) | |
| Constructs a Sprite object, of the specified width and height. | |
| Sprite (string surfaceFilename, Size size) | |
| Constructs a Sprite object, of the specified width and height. The given file is loaded automatically, and frames are cut out from it of the specified size. | |
| Sprite (Stream stream, int width, int height) | |
| Constructs a Sprite object, of the specified width and height. Frames are cut out from the given surface of the specified size. | |
| Sprite (Stream surfaceData, Size size) | |
| Constructs a Sprite object, of the specified width and height. A surface is loaded from the passed stream, and frames are cut out from it of the specified size. | |
| Sprite (string filename, int width, int height) | |
| Constructs a Sprite object, of the specified width and height. The given file is loaded automatically, and frames are cut out from it of the specified size. | |
| Sprite (Surface surface, bool ownSurface, int width, int height) | |
| Constructs a Sprite object, of the specified width and height. Frames are cut out from the given surface of the specified size. | |
| Sprite (Surface surface, bool ownSurface, Size size) | |
| Constructs a Sprite object, of the specified width and height. | |
| Sprite (AgateResourceCollection resources, string name) | |
| Constructs a sprite from a resource. | |
| void | AddFrame (Surface surface, bool ownSurface, Rectangle bounds, Point offset) |
| Adds a frame to the sprite. | |
| Sprite | Clone () |
| Makes a copy of this sprite and returns it. | |
| void | Dispose () |
| Disposes of unmanaged resources associated with this sprite. | |
| void | AddNewFrames (string filename, Point startPoint, Point extraSpace, bool skipBlank) |
| Adds frames from the given filename, using the size of this sprite. Frames are taken from startPoint, and with extraSpace inbetween. | |
| void | AddNewFrames (Stream stream, Point startPoint, Point extraSpace, bool skipBlank) |
| Adds frames by constructing a surface from the given stream, using the size of this sprite. Frames are taken from startPoint, and with extraSpace inbetween. | |
| void | AddNewFrames (Surface surface, bool ownSurface, Point startPoint, Point extraSpace, Size size, bool skipBlank) |
| Slices and dices the image passed into frames and adds them. Frames are taken from the surface from left to right. | |
| void | Draw (Rectangle destRect) |
| Draw the sprite to the given destination rectangle. Overrides scaling settings. | |
| void | Draw (int destX, int destY) |
| Draws the sprite at the specified position on screen. | |
| void | Draw (float destX, float destY) |
| Draws the sprite at the specified position on screen. | |
| void | Draw (Point destPt) |
| Draws the sprite at the specified position on screen. | |
| void | Draw (Vector2 destPt) |
| Draws the sprite at the specified position on screen. | |
| void | Draw (PointF destPt) |
| Draws the sprite at the specified position on screen. | |
| void | DrawPoints (Point[] dest_pts) |
| Draws the sprite at all the specified positions on screen. | |
| void | Draw () |
| Draws the sprite at the origin. | |
| void | DrawRects (Rectangle[] dest_rects) |
| Draws the sprite at the specified rectangles. | |
| void | SetScale (double x, double y) |
| Sets the scale of the sprite. | |
| void | GetScale (out double x, out double y) |
| Gets the scale of the sprite. | |
| void | IncrementRotationAngle (double radians) |
| Increments the rotation angle by the specified number of radians. | |
| void | IncrementRotationAngleDegrees (double degrees) |
| Increments the rotation angle by the specified number of degrees. | |
| void | Update () |
| Updates the animation of the sprite, using the DeltaTime given by the Display object. | |
| void | Update (double time_ms) |
| Updates the animation of the sprite, using the given frame time. | |
| void | AdvanceFrame () |
| Shows the next frame in the sequence. This pays attention to whether the animation is playing forwards or reverse. | |
| void | StartAnimation () |
| Restarts the animation. | |
Properties | |
| int | SpriteWidth [get] |
| Gets width of the sprite. | |
| int | SpriteHeight [get] |
| Gets height of the sprite. | |
| Size | SpriteSize [get] |
| Gets the size of the sprite. | |
| double | ScaleWidth [get, set] |
| Gets or sets the amount the width is scaled. | |
| double | ScaleHeight [get, set] |
| Gets or sets the amount the height is scaled. | |
| int | DisplayWidth [get, set] |
| Gets the width of the sprite when displayed. | |
| int | DisplayHeight [get, set] |
| Gets the height of the sprite when displayed. | |
| Size | DisplaySize [get, set] |
| Gets or sets the size of the sprite when displayed. | |
| double | Alpha [get, set] |
| Gets or sets transparency value. 0.0 is completely transparent 1.0 is completely opaque. | |
| double | RotationAngle [get, set] |
| Gets or sets the rotation angle in radians. | |
| double | RotationAngleDegrees [get, set] |
| Gets or sets the rotation angle in degrees. | |
| OriginAlignment | RotationCenter [get, set] |
| Gets or sets the center of rotation. | |
| OriginAlignment | DisplayAlignment [get, set] |
| Gets or sets the interpretation of the position. | |
| Color | Color [get, set] |
| Gets or sets the color of the sprite. | |
| Gradient | ColorGradient [get, set] |
| Gets or sets the color gradient on the sprite. | |
| bool | Visible [get, set] |
| Gets or sets whether or not the sprite should be drawn when Draw is called. | |
| double | TimePerFrame [get, set] |
| The amount of time each frame should display, in milliseconds. | |
| int | CurrentFrameIndex [get, set] |
| The index of the current frame. | |
| SpriteFrame | CurrentFrame [get] |
| Gets the currently displaying frame. | |
| bool | PlayReverse [get, set] |
| Gets or sets a flag which indicates whether or not this animation plays in reverse instead. | |
| SpriteAnimType | AnimationType [get, set] |
| Gets or sets an enum value indicating what type of animation is happening. Looping - The animation will play from beginning to end and then restart. PingPong - The animation will play from beginning to end and then from end to beginning (continuously). Once - The animation plays once, and then shows its first frame. OnceHoldLast - The animation plays once, and leaves the last frame on. | |
| bool | IsAnimating [get, set] |
| Gets or sets a flag which indicates: True if the animation is running. False if a single frame will be shown indefinitely. | |
| IFrameList | Frames [get] |
| Gets the list of frames in this sprite. | |
Events | |
| SpriteEventHandler | AnimationStopped |
| Event which is raised when the animation is stopped. | |
| SpriteEventHandler | AnimationStarted |
| Event which is raised when the animation is started. | |
| SpriteEventHandler | PlayDirectionChanged |
| Event which is raised when the play direction is changed, as in the PingPong type. | |
| AgateLib.Sprites.Sprite.Sprite | ( | int | width, | |
| int | height | |||
| ) |
| AgateLib.Sprites.Sprite.Sprite | ( | Size | size | ) |
| AgateLib.Sprites.Sprite.Sprite | ( | string | surfaceFilename, | |
| Size | size | |||
| ) |
Constructs a Sprite object, of the specified width and height. The given file is loaded automatically, and frames are cut out from it of the specified size.
| surfaceFilename | ||
| size |
| AgateLib.Sprites.Sprite.Sprite | ( | Stream | stream, | |
| int | width, | |||
| int | height | |||
| ) |
Constructs a Sprite object, of the specified width and height. Frames are cut out from the given surface of the specified size.
| stream | ||
| height | ||
| width |
| AgateLib.Sprites.Sprite.Sprite | ( | Stream | surfaceData, | |
| Size | size | |||
| ) |
Constructs a Sprite object, of the specified width and height. A surface is loaded from the passed stream, and frames are cut out from it of the specified size.
| surfaceData | ||
| size |
| AgateLib.Sprites.Sprite.Sprite | ( | string | filename, | |
| int | width, | |||
| int | height | |||
| ) |
Constructs a Sprite object, of the specified width and height. The given file is loaded automatically, and frames are cut out from it of the specified size.
| filename | ||
| width | ||
| height |
| AgateLib.Sprites.Sprite.Sprite | ( | Surface | surface, | |
| bool | ownSurface, | |||
| int | width, | |||
| int | height | |||
| ) |
| AgateLib.Sprites.Sprite.Sprite | ( | AgateResourceCollection | resources, | |
| string | name | |||
| ) |
Constructs a sprite from a resource.
| resources | ||
| name |
| void AgateLib.Sprites.Sprite.AddFrame | ( | Surface | surface, | |
| bool | ownSurface, | |||
| Rectangle | bounds, | |||
| Point | offset | |||
| ) |
Adds a frame to the sprite.
| surface | The surface from which to get the image data. | |
| bounds | The source rectangle for the image data used in the sprite frame to be added. | |
| ownSurface | Pass true to indicate that this sprite should own the surface and dispose of it when finished. | |
| offset | The offset within the sprite to the upperleft corner of where the frame is drawn. |
| void AgateLib.Sprites.Sprite.AddNewFrames | ( | Surface | surface, | |
| bool | ownSurface, | |||
| Point | startPoint, | |||
| Point | extraSpace, | |||
| Size | size, | |||
| bool | skipBlank | |||
| ) |
Slices and dices the image passed into frames and adds them. Frames are taken from the surface from left to right.
| surface | ||
| ownSurface | Pass true to indicate that this sprite should own the surface, and handle its disposal. | |
| startPoint | The starting point in pixels from which to parse frames. | |
| size | The size of the image to cut out for each frame | |
| extraSpace | How many extra pixels to insert between each frame. | |
| skipBlank | Whether or not blank frames should be automatically dropped. |
| void AgateLib.Sprites.Sprite.AddNewFrames | ( | Stream | stream, | |
| Point | startPoint, | |||
| Point | extraSpace, | |||
| bool | skipBlank | |||
| ) |
Adds frames by constructing a surface from the given stream, using the size of this sprite. Frames are taken from startPoint, and with extraSpace inbetween.
| stream | ||
| startPoint | ||
| extraSpace | ||
| skipBlank |
| void AgateLib.Sprites.Sprite.AddNewFrames | ( | string | filename, | |
| Point | startPoint, | |||
| Point | extraSpace, | |||
| bool | skipBlank | |||
| ) |
Adds frames from the given filename, using the size of this sprite. Frames are taken from startPoint, and with extraSpace inbetween.
| filename | ||
| startPoint | ||
| extraSpace | ||
| skipBlank |
| void AgateLib.Sprites.Sprite.AdvanceFrame | ( | ) |
Shows the next frame in the sequence. This pays attention to whether the animation is playing forwards or reverse.
Implements AgateLib.DisplayLib.ISprite.
| Sprite AgateLib.Sprites.Sprite.Clone | ( | ) |
Makes a copy of this sprite and returns it.
| void AgateLib.Sprites.Sprite.Dispose | ( | ) |
Disposes of unmanaged resources associated with this sprite.
| void AgateLib.Sprites.Sprite.Draw | ( | ) |
Draws the sprite at the origin.
| void AgateLib.Sprites.Sprite.Draw | ( | PointF | destPt | ) |
Draws the sprite at the specified position on screen.
| destPt |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.Sprite.Draw | ( | Vector2 | destPt | ) |
Draws the sprite at the specified position on screen.
| destPt |
| void AgateLib.Sprites.Sprite.Draw | ( | Point | destPt | ) |
Draws the sprite at the specified position on screen.
| destPt |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.Sprite.Draw | ( | float | destX, | |
| float | destY | |||
| ) |
Draws the sprite at the specified position on screen.
| destX | ||
| destY |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.Sprite.Draw | ( | int | destX, | |
| int | destY | |||
| ) |
Draws the sprite at the specified position on screen.
| destX | ||
| destY |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.Sprite.Draw | ( | Rectangle | destRect | ) |
Draw the sprite to the given destination rectangle. Overrides scaling settings.
| destRect |
| void AgateLib.Sprites.Sprite.DrawPoints | ( | Point[] | dest_pts | ) |
Draws the sprite at all the specified positions on screen.
| dest_pts |
| void AgateLib.Sprites.Sprite.DrawRects | ( | Rectangle[] | dest_rects | ) |
Draws the sprite at the specified rectangles.
| dest_rects |
| void AgateLib.Sprites.Sprite.GetScale | ( | out double | x, | |
| out double | y | |||
| ) |
| void AgateLib.Sprites.Sprite.IncrementRotationAngle | ( | double | radians | ) |
Increments the rotation angle by the specified number of radians.
| radians |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.Sprite.IncrementRotationAngleDegrees | ( | double | degrees | ) |
Increments the rotation angle by the specified number of degrees.
| degrees |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.Sprite.SetScale | ( | double | x, | |
| double | y | |||
| ) |
| void AgateLib.Sprites.Sprite.StartAnimation | ( | ) |
| void AgateLib.Sprites.Sprite.Update | ( | double | time_ms | ) |
Updates the animation of the sprite, using the given frame time.
| time_ms | The amount of time to consider passed, in milliseconds. |
Implements AgateLib.DisplayLib.ISprite.
| void AgateLib.Sprites.Sprite.Update | ( | ) |
Updates the animation of the sprite, using the DeltaTime given by the Display object.
Implements AgateLib.DisplayLib.ISprite.
double AgateLib.Sprites.Sprite.Alpha [get, set] |
Gets or sets transparency value. 0.0 is completely transparent 1.0 is completely opaque.
Implements AgateLib.DisplayLib.ISurface.
SpriteAnimType AgateLib.Sprites.Sprite.AnimationType [get, set] |
Gets or sets an enum value indicating what type of animation is happening. Looping - The animation will play from beginning to end and then restart. PingPong - The animation will play from beginning to end and then from end to beginning (continuously). Once - The animation plays once, and then shows its first frame. OnceHoldLast - The animation plays once, and leaves the last frame on.
Implements AgateLib.DisplayLib.ISprite.
Color AgateLib.Sprites.Sprite.Color [get, set] |
Gradient AgateLib.Sprites.Sprite.ColorGradient [get, set] |
SpriteFrame AgateLib.Sprites.Sprite.CurrentFrame [get] |
int AgateLib.Sprites.Sprite.CurrentFrameIndex [get, set] |
OriginAlignment AgateLib.Sprites.Sprite.DisplayAlignment [get, set] |
int AgateLib.Sprites.Sprite.DisplayHeight [get, set] |
Size AgateLib.Sprites.Sprite.DisplaySize [get, set] |
int AgateLib.Sprites.Sprite.DisplayWidth [get, set] |
IFrameList AgateLib.Sprites.Sprite.Frames [get] |
bool AgateLib.Sprites.Sprite.IsAnimating [get, set] |
Gets or sets a flag which indicates: True if the animation is running. False if a single frame will be shown indefinitely.
Implements AgateLib.DisplayLib.ISprite.
bool AgateLib.Sprites.Sprite.PlayReverse [get, set] |
Gets or sets a flag which indicates whether or not this animation plays in reverse instead.
Implements AgateLib.DisplayLib.ISprite.
double AgateLib.Sprites.Sprite.RotationAngle [get, set] |
double AgateLib.Sprites.Sprite.RotationAngleDegrees [get, set] |
OriginAlignment AgateLib.Sprites.Sprite.RotationCenter [get, set] |
double AgateLib.Sprites.Sprite.ScaleHeight [get, set] |
double AgateLib.Sprites.Sprite.ScaleWidth [get, set] |
int AgateLib.Sprites.Sprite.SpriteHeight [get] |
Size AgateLib.Sprites.Sprite.SpriteSize [get] |
int AgateLib.Sprites.Sprite.SpriteWidth [get] |
double AgateLib.Sprites.Sprite.TimePerFrame [get, set] |
The amount of time each frame should display, in milliseconds.
Implements AgateLib.DisplayLib.ISprite.
bool AgateLib.Sprites.Sprite.Visible [get, set] |
Gets or sets whether or not the sprite should be drawn when Draw is called.
Implements AgateLib.DisplayLib.ISprite.
| SpriteEventHandler AgateLib.Sprites.Sprite.AnimationStarted |
| SpriteEventHandler AgateLib.Sprites.Sprite.AnimationStopped |
| SpriteEventHandler AgateLib.Sprites.Sprite.PlayDirectionChanged |
Event which is raised when the play direction is changed, as in the PingPong type.
Implements AgateLib.DisplayLib.ISprite.
|
AgateLib Awesome Game and Tool Engine Library |
|