ConvexShape


Object Hierarchy:

Object hierarchy for ConvexShape

Description:

[ Compact ]
[ CCode ( cname = "sfConvexShape" , copy_function = "sfConvexShape_copy" , cprefix = "sfConvexShape_" , free_function = "sfConvexShape_destroy" ) ]
public class ConvexShape : Shape

Specialized shape representing a convex polygon

This class inherits all the functions of sf.Transformable (position, rotation, scale, bounds, ...) as well as the functions of sf.Shape (outline, color, texture, ...).

It is important to keep in mind that a convex shape must always be... convex, otherwise it may not be drawn correctly. Moreover, the points must be defined in order; using a random order would result in an incorrect shape.

Usage example:

polygon = new ConvexShape();
polygon.setPointCount(3);
polygon.setPoint(0, sf.Vector2f(0, 0));
polygon.setPoint(1, sf.Vector2f(0, 10));
polygon.setPoint(2, sf.Vector2f(25, 5));
polygon.setOutlineColor(sf.Color.Red);
polygon.setOutlineThickness(5);
polygon.setPosition(10, 20);
...
window.draw(polygon);

See also:

sf.Shape, sf.RectangleShape, sf.CircleShape


Namespace: sf
Package: sfml

Content:

Properties:

Creation methods:

Methods:

Inherited Members: