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
|
@ -25,6 +25,17 @@ namespace SFML
|
|||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Construct the shape from another shape
|
||||
/// </summary>
|
||||
/// <param name="copy">Shape to copy</param>
|
||||
////////////////////////////////////////////////////////////
|
||||
public Shape(Shape copy) :
|
||||
base(sfShape_Copy(copy.This))
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Position of the object on screen
|
||||
|
@ -361,6 +372,25 @@ namespace SFML
|
|||
return new Shape(sfShape_CreateCircle(center.X, center.Y, radius, color, outline, outlineColor));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Provide a string describing the object
|
||||
/// </summary>
|
||||
/// <returns>String description of the object</returns>
|
||||
////////////////////////////////////////////////////////////
|
||||
public override string ToString()
|
||||
{
|
||||
return "[Shape]" +
|
||||
" Position = " + Position +
|
||||
" Rotation = " + Rotation +
|
||||
" Scale = " + Scale +
|
||||
" Origin = " + Origin +
|
||||
" Color = " + Color +
|
||||
" BlendMode = " + BlendMode +
|
||||
" OutlineWidth = " + OutlineWidth +
|
||||
" NbPoints = " + NbPoints;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Render the object into the given render window
|
||||
|
@ -417,6 +447,9 @@ namespace SFML
|
|||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfShape_Create();
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfShape_Copy(IntPtr Shape);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfShape_Destroy(IntPtr This);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue