Public Member Functions | |
| void | Dispose () |
| Reduces the reference counter for this class, and disposes of unmanaged resources if the counter hits zero. | |
| void | AddRef () |
| Adds one to the reference counter. | |
| SpriteFrame | Clone () |
| Copies this object. | |
| void | SetFrameNoTrim (Surface srcSurface, Point offset, Size originalSize) |
| Sets the frame of this object, and does not trim it. | |
| void | SetFrame (Surface srcSurface, Point location, Size size) |
| Sets the frame from a section of the source surface. | |
| void | SetFrame (Surface srcSurface, int x, int y, int width, int height) |
| Sets the frame from a section of the source surface. | |
| void | SetFrame (Surface srcSurface, Rectangle rect) |
| Sets the frame from a section of the source surface. | |
| void | Draw (float dest_x, float dest_y, float rotationCenterX, float rotationCenterY) |
| Draws this surface at the specified destination point with the specified rotation center. | |
Properties | |
| bool | IsDisposed [get] |
| Returns true if the internal unmanaged resources have been disposed. This happens when Dispose is called until the reference count is zero. | |
| bool | IsBlank [get] |
| Returns true if the entire frame is transparent. | |
| Surface | Surface [get] |
| Returns the surface object which is drawn. | |
| Size | DisplaySize [get, set] |
| Gets or sets the display size. | |
| Size | OriginalSize [get] |
| Gets the original size of the frame. | |
This class can automatically trim the frame, so that extra space around the object which is transparent is not drawn. This is taken advantage of if surfaces are packed to create a tighter packing and fit more objects on the same texture.
SpriteFrame contains a reference count. If you manually copy it, be sure to call AddRef unless you use the Clone method.
| void ERY.AgateLib.SpriteFrame.Dispose | ( | ) |
Reduces the reference counter for this class, and disposes of unmanaged resources if the counter hits zero.
| void ERY.AgateLib.SpriteFrame.AddRef | ( | ) |
Adds one to the reference counter.
| SpriteFrame ERY.AgateLib.SpriteFrame.Clone | ( | ) |
Copies this object.
Actually, this just increases the reference counter and returns this object. Be sure to Dispose the result when finished with it.
| void ERY.AgateLib.SpriteFrame.SetFrameNoTrim | ( | Surface | srcSurface, | |
| Point | offset, | |||
| Size | originalSize | |||
| ) |
Sets the frame of this object, and does not trim it.
| srcSurface | ||
| offset | ||
| originalSize |
Sets the frame from a section of the source surface.
| srcSurface | ||
| location | ||
| size |
| void ERY.AgateLib.SpriteFrame.SetFrame | ( | Surface | srcSurface, | |
| int | x, | |||
| int | y, | |||
| int | width, | |||
| int | height | |||
| ) |
Sets the frame from a section of the source surface.
| srcSurface | ||
| x | ||
| y | ||
| width | ||
| height |
Sets the frame from a section of the source surface.
| srcSurface | ||
| rect |
| void ERY.AgateLib.SpriteFrame.Draw | ( | float | dest_x, | |
| float | dest_y, | |||
| float | rotationCenterX, | |||
| float | rotationCenterY | |||
| ) |
Draws this surface at the specified destination point with the specified rotation center.
| dest_x | ||
| dest_y | ||
| rotationCenterX | ||
| rotationCenterY |
bool ERY.AgateLib.SpriteFrame.IsDisposed [get] |
Returns true if the internal unmanaged resources have been disposed. This happens when Dispose is called until the reference count is zero.
bool ERY.AgateLib.SpriteFrame.IsBlank [get] |
Returns true if the entire frame is transparent.
Surface ERY.AgateLib.SpriteFrame.Surface [get] |
Returns the surface object which is drawn.
Size ERY.AgateLib.SpriteFrame.DisplaySize [get, set] |
Gets or sets the display size.
Size ERY.AgateLib.SpriteFrame.OriginalSize [get] |
Gets the original size of the frame.
|
AgateLib Awesome Game and Tool Engine Library |
|