|
MakeMapGfx | |
MakeMapGfx MapIndex, ImageIndex, TileWidth, TileHeight, NumbOfTiles, TransparentColour, [Format=1] | |
Parameters: MapIndex = The Index Identifier of the Map you wish to assign this level to. ImageIndex = The index of the Image you wish to build this maps Tile Graphics from. TileWidth = The Width in pixels of the tiles TileHeight = The Height in pixels of the tiles NumbOfTiles = The number of tiles to grab from this image TransparentColour = The transparent colour (in RGB fromat) to use for these tiles. [Format=1] = The image format of graphical blocks (1=Video, 2= FX, 4 = AFX) |
|
Returns: NONE | |
MakeMapGfx will import any Image into a map as the maps graphical tiles. Maps store the tiles internally in a special format, so once the tiles have been imported from your image, the source image can be safely deleted. The tiles will be of whatever size (width and height) you specify. They are grabbed from the image starting from top left hand corner scanning across each line, until it reaches the bottom of the image. You can specify the number of tiles you wish to grab, which must be at least be one, and can be no larger than 1024 for Video formatted blocks (default) for 4096 or FX / AFX formatted blocks . During the block importation process, you'll need get to give the MakeMapGfx command the RGB value of the blocks transparent colour. This colour is used as the transparency mask when rendering levels that are set to 'transparent'. This is commonly used when various level are drawn over each to create parallax (multi layer) style effects. So setting this value incorrectly will no doubt result in your tiles not rendering with transparency. Block Formats:
FACTS: * Tiles are grabbed from left to right, starting from the top left hand corner of the source image and working down. * You can specfiy any number of tiles you like. The MakeMapGfx routine will only create/grab that amount. Regardless of the size of the image. * Each Map can only have 1024 video tiles, or 4096 in FX/AFX formats stored within them. * There's no limited upon the size(width/height) of the Tiles. * MakeMapGfx will automatically import any AFX image internally as an AFX map. Allow maps to support Alpha Channel. If you using Alpha channel, then set the Transparent Mask Colour to zero. Block Map Tile Import Order Example: The MakeMapGfx imports your block graphics from your source picture, it starts in the top left corner and moves across the image. If it reaches the right hand edge, it moves down a row and starts scanning from the left again. It will repeat this process until it reaches the end of the image, or the max number of user defined blocks. The example picture bellow is 320 by 240 pixels and contains 16 blocks, which are 80 * 60 pixels per block. This means that there's only 4 blocks per row, making the block image square. The block image doesn't have to square though, It just is in this example. Mini Tutorial: This example Creates a Map, then manually builds a tiled image, just so it can import it and finally build and display
|
Related Info: | CreateMapGfx | LoadAfxImage | LoadMapGfx | PrepareFXmap : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |