Tile An Effect

   Print  Previous  Next

Settings

As is the case for mapping and drawing functions, for tiling functions there is a vector and a pixel version. They work with relative values/coordinates between 0 and 1 or with absolute pixel values. The function to set tiles for an effect is called:

MapTileEffectVector(float x, float y, float w, float h)
MapTileEffectPixel(int x, int y, int w, int h)

 

The parameters x and y describe the start coordinates, whereas w and h describe the width and height of the tile. Values which may lead to the fact that the tile is partial or fully outside of the effect matrix are also possible.

Side Effects

If the size of the effect matrix is changed due to a call of the function MapTileEffect, the script is reinitialized and restarted with a call of InitEffect. This does not happen if solely the position of the effect matrix is changed.

 

Getting the Current Tile Settings

Via a call of one of the following functions, it is also possible to retrieve the current tile settings:

int GetMapTileEffectVector(float map[])
int GetMapTileEffectPixel(int map[]) 

 

Both functions return true if the effect is currently mapped and false if the effect uses the whole matrix. The parameter map needs to be a field, which is filled with the current tile settings as described below:

map[0] = x
map[1] = y
map[2] = width
map[3] = height

 

Values x and y describe the start coordinates of the tile relative to the eventually mapped effect matrix. The parameters width and height describe the width and height of the tile and therefore of the effect's matrix.

 

Setting and Getting Tile Modes

Setting Modes

For tiles it is possible to set a mirror and a tile mode. This can be done using the functions

void SetMapModeMirror(int mirrorMode)
void SetMapModeTile(int tileMode) 

 

For the parameter mirrorMode one of the MAP_MIRROR_x constants must be used. The parameter tileMode needs to be one of the MAP_TILE_x constants. (Those constants are describe in the List of Global Variables and Constants).

Retrieving Modes

There is also the pssobility to get the current settings.

int GetMapModeMirror()
int GetMapModeTile() 

 

GetMapModeMirror returns a MAP_MIRROR_x constant, which describes the current mirror settings. GetMapModeTile returns a MAP_TILE_x constant, which describes the current tile settings.