FS#145 - Implement copy constructors and ToString functions in SFML.Net
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1330 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
bd9a60fef2
commit
dd255a916d
28 changed files with 627 additions and 0 deletions
|
@ -36,6 +36,18 @@ namespace SFML
|
|||
Image = image;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Construct the sprite from another sprite
|
||||
/// </summary>
|
||||
/// <param name="copy">Sprite to copy</param>
|
||||
////////////////////////////////////////////////////////////
|
||||
public Sprite(Sprite copy) :
|
||||
base(sfSprite_Copy(copy.This))
|
||||
{
|
||||
Image = copy.Image;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Position of the object on screen
|
||||
|
@ -215,6 +227,27 @@ namespace SFML
|
|||
return sfSprite_GetPixel(This, x, y);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Provide a string describing the object
|
||||
/// </summary>
|
||||
/// <returns>String description of the object</returns>
|
||||
////////////////////////////////////////////////////////////
|
||||
public override string ToString()
|
||||
{
|
||||
return "[Sprite]" +
|
||||
" Position = " + Position +
|
||||
" Rotation = " + Rotation +
|
||||
" Scale = " + Scale +
|
||||
" Origin = " + Origin +
|
||||
" Color = " + Color +
|
||||
" BlendMode = " + BlendMode +
|
||||
" Width = " + Width +
|
||||
" Height = " + Height +
|
||||
" SubRect = " + SubRect +
|
||||
" Image = " + Image;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Render the object into the given render window
|
||||
|
@ -262,6 +295,9 @@ namespace SFML
|
|||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfSprite_Create();
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfSprite_Copy(IntPtr Sprite);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfSprite_Destroy(IntPtr This);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue