C# Class SFML.Graphics.ConvexShape

Specialized shape representing a convex polygon
Inheritance: Shape
Show file Open project: SFML/SFML.Net Class Usage Examples

Public Methods

Method Description
ConvexShape ( ) : System

Default constructor

ConvexShape ( ConvexShape copy ) : System

Construct the shape from another shape

ConvexShape ( uint pointCount ) : System

Construct the shape with an initial point count

GetPoint ( uint index ) : Vector2f

Get the position of a point The returned point is in local coordinates, that is, the shape's transforms (position, rotation, scale) are not taken into account. The result is undefined if index is out of the valid range.

GetPointCount ( ) : uint

Get the total number of points of the polygon

SetPoint ( uint index, Vector2f point ) : void

Set the position of a point. Don't forget that the polygon must remain convex, and the points need to stay ordered! PointCount must be set first in order to set the total number of points. The result is undefined if index is out of the valid range.

SetPointCount ( uint count ) : void

Set the number of points of the polygon. The count must be greater than 2 to define a valid shape.

Method Details

ConvexShape() public method

Default constructor
public ConvexShape ( ) : System
return System

ConvexShape() public method

Construct the shape from another shape
public ConvexShape ( ConvexShape copy ) : System
copy ConvexShape Shape to copy
return System

ConvexShape() public method

Construct the shape with an initial point count
public ConvexShape ( uint pointCount ) : System
pointCount uint Number of points of the shape
return System

GetPoint() public method

Get the position of a point The returned point is in local coordinates, that is, the shape's transforms (position, rotation, scale) are not taken into account. The result is undefined if index is out of the valid range.
public GetPoint ( uint index ) : Vector2f
index uint Index of the point to get, in range [0 .. PointCount - 1]
return Vector2f

GetPointCount() public method

Get the total number of points of the polygon
public GetPointCount ( ) : uint
return uint

SetPoint() public method

Set the position of a point. Don't forget that the polygon must remain convex, and the points need to stay ordered! PointCount must be set first in order to set the total number of points. The result is undefined if index is out of the valid range.
public SetPoint ( uint index, Vector2f point ) : void
index uint Index of the point to change, in range [0 .. PointCount - 1]
point Vector2f New position of the point
return void

SetPointCount() public method

Set the number of points of the polygon. The count must be greater than 2 to define a valid shape.
public SetPointCount ( uint count ) : void
count uint New number of points of the polygon
return void