class convex_shape :
?position:float * float -> ?scale:float * float -> ?rotation:float -> ?origin:float * float -> ?texture:#const_texture -> ?texture_rect:IntRect.t -> ?fill_color:Color.t -> ?outline_color:Color.t -> ?outline_thickness:float -> ?points:(float * float) list -> unit ->
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.
let polygon = new convex_shape
~points:[(0.,0.) ; (0.,10.) ; (25., 5.)]
~position:(10.,20.) ()) in
method destroy :
method set_point :
int -> float * float -> unit
Don't forget that the polygon must remain convex, and the points
need to stay ordered! SetPointCount must be called first in
order to set the total number of points. The result is undefined
if index is out of the valid range.
method set_point_count :
int -> unit
count must be greater than 2 to define a valid shape.