|
CreateShape | |
CreateShape ShapeIndex, NumbOfVertex, NumbOfEdges | |
Parameters: ShapeIndex = The Index of the shape you wish to create NumbOfVertex = The number of vertex NumbOfEdges = The number of edges |
|
Returns: NONE | |
CreateShape initializes a shapes vertex and edge buffers ready for use. Shapes have a dual purpose in PlayBASIC, you can use them to render filled polygons or for complex collision operations if you like. To construct a shape we need two things. First we define a set of points (called vertex). The points are the corners of your shape. Next we join these points together to form the edges of the shape. The edges that we connect are assumed to create an enclosed space. But they don't actually have to, as one of the beauties of shapes, is we can pretty much join any points we like together, and the DrawShape command will try and render it. FACTS: * Shape Vertex indexes ranges between Zero and MaxVertex-1 * Shape Edge indexes ranges between Zero and MaxEdges-1 Mini Tutorial: This example creates a shape. First it initializes the shape, then it defines a list of vertex and then connects these points as edges.
This example outputs, |
Related Info: | CreateConvexShape | GetFreeShape | LoadShape | NewConvexShape | NewShape | SaveShape | SpriteCollisionMode : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |