Public Member Functions | |
| PackedSprite (int width, int height) | |
| Constructs a Sprite object, of the specified width and height. | |
| PackedSprite (Size size) | |
| Constructs a Sprite object, of the specified width and height. | |
| PackedSprite (string filename, 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. | |
| PackedSprite (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. | |
| PackedSprite (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. | |
| PackedSprite (Surface surface, bool ownSurface, Size size) | |
| Constructs a PackedSprite object, of the specified width and height. | |
| PackedSprite (Stream stream, Size size) | |
| Constructs a Sprite object, of the specified width and height. Frames are cut out from the given surface of the specified size. | |
| PackedSprite (string name, AgateResourceCollection resources) | |
| Constructs a Sprite object, loading it from the file specified in the given ResourceManager object. It is not recommended to use this constructor, but instead to use the CreateSprite() of the AgateResourceCollection object. | |
| void | AddFrame (Rectangle bounds, Point offset) |
| Adds a frame to the sprite. | |
| PackedSprite | Clone () |
| Makes a copy of this sprite and returns it. | |
| void | Dispose () |
| Disposes of unmanaged resources associated with this sprite. | |
| void | AddFrames () |
| Adds frames from the given surface, using the size of this sprite. | |
| void | AddFrames (string filename) |
| Slices and dices the image passed into frames and adds them. Automatically skips blank ones. This can only called if there is no surface object backing the sprite. | |
| void | AddFrames (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 | AddFrames (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 | CompressFrames () |
| Compresses the frames of the sprite eliminating blank space so that sprites can be packed on a surface. | |
| 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. | |
| virtual void | BeginQueueRects () |
| virtual void | BeginQueueRects (int guessCount) |
| virtual void | QueueRect (Rectangle src_rect, Rectangle dest_rect) |
| virtual void | EndQueueRects () |
| 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 | |
| bool | OwnSurface [get] |
| Returns true if this Sprite2 owns the surface backing the image data. | |
| 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. | |
| PackedSpriteFrame | 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 SpriteFrame2 objects 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.PackedSprite.PackedSprite | ( | int | width, | |
| int | height | |||
| ) |
Constructs a Sprite object, of the specified width and height.
| width | ||
| height |
| AgateLib.Sprites.PackedSprite.PackedSprite | ( | Size | size | ) |
Constructs a Sprite object, of the specified width and height.
| size |
| AgateLib.Sprites.PackedSprite.PackedSprite | ( | string | filename, | |
| 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.
| filename | ||
| size |
| AgateLib.Sprites.PackedSprite.PackedSprite | ( | 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.PackedSprite.PackedSprite | ( | 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.
| surface | ||
| ownSurface | True to indicate that this PackedSprite object owns the surface, so it is disposed when this Sprite is disposed. | |
| width | ||
| height |
Constructs a PackedSprite object, of the specified width and height.
| surface | ||
| ownSurface | True to indicate that this PackedSprite object owns the surface, so it is disposed when this Sprite is disposed. | |
| size |
| AgateLib.Sprites.PackedSprite.PackedSprite | ( | Stream | stream, | |
| Size | size | |||
| ) |
Constructs a Sprite object, of the specified width and height. Frames are cut out from the given surface of the specified size.
| stream | ||
| size |
| AgateLib.Sprites.PackedSprite.PackedSprite | ( | string | name, | |
| AgateResourceCollection | resources | |||
| ) |
Constructs a Sprite object, loading it from the file specified in the given ResourceManager object. It is not recommended to use this constructor, but instead to use the CreateSprite() of the AgateResourceCollection object.
| name | ||
| resources |
Adds a frame to the sprite.
| bounds | The source rectangle for the image data used in the sprite frame to be added. | |
| offset | The offset within the sprite to the upperleft corner of where the frame is drawn. |
| void AgateLib.Sprites.PackedSprite.AddFrames | ( | 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.
| 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.PackedSprite.AddFrames | ( | 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.PackedSprite.AddFrames | ( | string | filename | ) |
Slices and dices the image passed into frames and adds them. Automatically skips blank ones. This can only called if there is no surface object backing the sprite.
| filename |
| void AgateLib.Sprites.PackedSprite.AddFrames | ( | ) |
Adds frames from the given surface, using the size of this sprite.
| void AgateLib.Sprites.PackedSprite.AdvanceFrame | ( | ) |
Shows the next frame in the sequence. This pays attention to whether the animation is playing forwards or reverse.
Implements AgateLib.DisplayLib.ISprite.
| virtual void AgateLib.Sprites.PackedSprite.BeginQueueRects | ( | int | guessCount | ) | [virtual] |
| guessCount |
| virtual void AgateLib.Sprites.PackedSprite.BeginQueueRects | ( | ) | [virtual] |
| PackedSprite AgateLib.Sprites.PackedSprite.Clone | ( | ) |
Makes a copy of this sprite and returns it.
| void AgateLib.Sprites.PackedSprite.CompressFrames | ( | ) |
Compresses the frames of the sprite eliminating blank space so that sprites can be packed on a surface.
| void AgateLib.Sprites.PackedSprite.Dispose | ( | ) |
Disposes of unmanaged resources associated with this sprite.
| void AgateLib.Sprites.PackedSprite.Draw | ( | ) |
Draws the sprite at the origin.
| void AgateLib.Sprites.PackedSprite.Draw | ( | PointF | destPt | ) |
Draws the sprite at the specified position on screen.
| destPt |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.PackedSprite.Draw | ( | Vector2 | destPt | ) |
Draws the sprite at the specified position on screen.
| destPt |
| void AgateLib.Sprites.PackedSprite.Draw | ( | Point | destPt | ) |
Draws the sprite at the specified position on screen.
| destPt |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.PackedSprite.Draw | ( | float | destX, | |
| float | destY | |||
| ) |
Draws the sprite at the specified position on screen.
| destX | ||
| destY |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.PackedSprite.Draw | ( | int | destX, | |
| int | destY | |||
| ) |
Draws the sprite at the specified position on screen.
| destX | ||
| destY |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.PackedSprite.Draw | ( | Rectangle | destRect | ) |
Draw the sprite to the given destination rectangle. Overrides scaling settings.
| destRect |
| void AgateLib.Sprites.PackedSprite.DrawPoints | ( | Point[] | dest_pts | ) |
Draws the sprite at all the specified positions on screen.
| dest_pts |
| void AgateLib.Sprites.PackedSprite.DrawRects | ( | Rectangle[] | dest_rects | ) |
Draws the sprite at the specified rectangles.
| dest_rects |
| virtual void AgateLib.Sprites.PackedSprite.EndQueueRects | ( | ) | [virtual] |
| void AgateLib.Sprites.PackedSprite.GetScale | ( | out double | x, | |
| out double | y | |||
| ) |
| void AgateLib.Sprites.PackedSprite.IncrementRotationAngle | ( | double | radians | ) |
Increments the rotation angle by the specified number of radians.
| radians |
Implements AgateLib.DisplayLib.ISurface.
| void AgateLib.Sprites.PackedSprite.IncrementRotationAngleDegrees | ( | double | degrees | ) |
Increments the rotation angle by the specified number of degrees.
| degrees |
Implements AgateLib.DisplayLib.ISurface.
| virtual void AgateLib.Sprites.PackedSprite.QueueRect | ( | Rectangle | src_rect, | |
| Rectangle | dest_rect | |||
| ) | [virtual] |
| src_rect | ||
| dest_rect |
| void AgateLib.Sprites.PackedSprite.SetScale | ( | double | x, | |
| double | y | |||
| ) |
| void AgateLib.Sprites.PackedSprite.StartAnimation | ( | ) |
| void AgateLib.Sprites.PackedSprite.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.PackedSprite.Update | ( | ) |
Updates the animation of the sprite, using the DeltaTime given by the Display object.
Implements AgateLib.DisplayLib.ISprite.
double AgateLib.Sprites.PackedSprite.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.PackedSprite.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.PackedSprite.Color [get, set] |
Gradient AgateLib.Sprites.PackedSprite.ColorGradient [get, set] |
PackedSpriteFrame AgateLib.Sprites.PackedSprite.CurrentFrame [get] |
int AgateLib.Sprites.PackedSprite.CurrentFrameIndex [get, set] |
OriginAlignment AgateLib.Sprites.PackedSprite.DisplayAlignment [get, set] |
int AgateLib.Sprites.PackedSprite.DisplayHeight [get, set] |
Size AgateLib.Sprites.PackedSprite.DisplaySize [get, set] |
int AgateLib.Sprites.PackedSprite.DisplayWidth [get, set] |
IFrameList AgateLib.Sprites.PackedSprite.Frames [get] |
bool AgateLib.Sprites.PackedSprite.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.PackedSprite.OwnSurface [get] |
Returns true if this Sprite2 owns the surface backing the image data.
bool AgateLib.Sprites.PackedSprite.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.PackedSprite.RotationAngle [get, set] |
double AgateLib.Sprites.PackedSprite.RotationAngleDegrees [get, set] |
OriginAlignment AgateLib.Sprites.PackedSprite.RotationCenter [get, set] |
double AgateLib.Sprites.PackedSprite.ScaleHeight [get, set] |
double AgateLib.Sprites.PackedSprite.ScaleWidth [get, set] |
int AgateLib.Sprites.PackedSprite.SpriteHeight [get] |
Size AgateLib.Sprites.PackedSprite.SpriteSize [get] |
int AgateLib.Sprites.PackedSprite.SpriteWidth [get] |
double AgateLib.Sprites.PackedSprite.TimePerFrame [get, set] |
The amount of time each frame should display, in milliseconds.
Implements AgateLib.DisplayLib.ISprite.
bool AgateLib.Sprites.PackedSprite.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.PackedSprite.AnimationStarted |
| SpriteEventHandler AgateLib.Sprites.PackedSprite.AnimationStopped |
| SpriteEventHandler AgateLib.Sprites.PackedSprite.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 |
|