Public Member Functions | |
| bool | SetGrid (int pNumBlocksX, int pNumBlocksY) |
| bool | SetVertexPos (int pVertexX, int pVertexY, int pX, int pY) |
| int | GetVertexPosX (int pVertexX, int pVertexY) |
| int | GetVertexPosY (int pVertexX, int pVertexY) |
| IND_Type | GetTypeInt () |
| This function returns the type of the surface. See IND_Type. | |
| IND_Quality | GetQualityInt () |
| This function returns the quality of the surface. See IND_Quality. | |
| int | GetNumTextures () |
| This function returns the number of textures the surface is using. | |
| int | GetWidth () |
| This function returns the width of the surface. | |
| int | GetHeight () |
| This function returns the height of the surface. | |
| int | GetBlocksX () |
| This function returns the number of blocks (width) in which the surface is divided. | |
| int | GetBlocksY () |
| This function returns the number of blocks (height) in which the surface is divided. | |
| int | GetNumBlocks () |
| This function returns the number of blocks in which the surface is divided. | |
| int | GetWidthBlock () |
| This function returns the width of each block in which the surface is divided. | |
| int | GetHeightBlock () |
| This function returns the height of each block in which the surface is divided. | |
| bool | IsHaveSurface () |
| This function returns 1 if the surface is loaded. | |
| bool | IsHaveGrid () |
| This function returns 1 if the surface have a grid assigned. | |
| char * | GetTypeChar () |
| This function returns the type of surface in a string of chars. | |
| char * | GetQualityChar () |
| This function returns the quality of the surface in one string of chars. See IND_Quality. | |
Friends | |
| class | IND_SurfaceManager |
| class | IND_Render |
| bool IND_Surface::SetGrid | ( | int | pNumBlocksX, | |
| int | pNumBlocksY | |||
| ) |
Parameters:
This method sets a grid to the IND_Surface object. A grid is just a mesh which vertices can be moved in order to deform the graphical object. You can set grids of different levels of tesselation.
Using grids you can apply lot of different morphing effects to your sprites or animations (waves, bubble animation, etc). It is also possible to change the position of all the vertices so it would be possible to create for example a "snake" sprite that could simulate the crawling when moving.
There is a restriction: the amount of horizontal and vertical blocks should be power of two.
Example:
| bool IND_Surface::SetVertexPos | ( | int | pVertexX, | |
| int | pVertexY, | |||
| int | pX, | |||
| int | pY | |||
| ) |
Parameters:
This method changes the position of one of the vertex of the grid. The vertices starts form 0 to n, from left to right and from up to down. So: (0,0) is the upper-left vertex of the grid and (n, n) is the lower-right vertex of the grid.
Remember that there is always one vertex more (horizontal or vertical) that number of blocks. For example, a grid of 2x2 blocks would have 3x3 vertices.
| int IND_Surface::GetVertexPosX | ( | int | pVertexX, | |
| int | pVertexY | |||
| ) |
Parameters:
This method returns the horizontal position of the vertex passed as parameter.
Remember that there is always one vertex more (horizontal or vertical) that number of blocks. For example, a grid of 2x2 blocks would have 3x3 vertices.
| int IND_Surface::GetVertexPosY | ( | int | pVertexX, | |
| int | pVertexY | |||
| ) |
Parameters:
This method returns the vertical position of the vertex passed as parameter.
Remember that there is always one vertex more (horizontal or vertical) that number of blocks. For example, a grid of 2x2 blocks would have 3x3 vertices.
1.5.4