SetTileImage
From Spheriki
Sets the image of a map tile in the map tile list. If a tile image is changed, all map tiles that refer to the tile will take on the appearance of the new image.
Contents |
Usage
- tile_index Number, non-negative. The index of the tile to change in the current map's list of tiles.
- image_object Sphere Image object. The new image to change the tile to.
Examples
Say we have a map filled with grass, composed of a single grass tile at index 3. We also have an image named blah.png in the game's images/ directory. We can change the grass tile to look like whatever is in images/blah.png:
SetTileImage(3, LoadImage("blah.png"));
This should run while the map engine is running, i.e. inside the MapEngine() call.
Notes
- This function only operates while the map engine is running.
- The tiles of a Sphere map are of uniform width and height. The result of attempting to set an image of different dimensions to a tile is undefined.
- To change tiles on the map itself, use SetTile().
See also
- Sphere Image object
- GetTileImage()
- LoadImage()
- MapEngine()
- SetTile()