Tools grid


Tidy Tile Mapper is an easy-to-use, intuitive and powerful tile-based game creator for Unity, perfect for creating both 2D and 3D tile-based games. More Information

Tidy Maze Maker is a plugin for Tidy Tile Mapper that allows you to generate mazes with which to amaze your friends and perplex your enemies. More Information

A handy little mesh-modifying script - perfect for creating water or fire in your favorite Tile-Mapping tool... Tidy Tile Mapper!
More Information

Tidy Text Adventures - the zero-code-required, text-based-adventure creation tool of your dreams!
More Information
 
Tidy Tile Mapper is an easy-to-use, intuitive and powerful tile-based map editor
for Unity, perfect for creating both 2D and 3D tile-based levels.

Monday, March 19, 2012

Tidy TileMapper: Runtime API

NOTE: This ad-hoc documentation has been replaced by a super-smooth API site, accessible via the sidebar on the left (Technical Documentation) or by clicking this link.

All API functions are held within the BlockUtilities class.

Example: To create a new block map with a standard tilesize you would call:

BlockUtilities.CreateBlockMap("NewMap",new Vector3(1.0f,1.0f,1.0f),5,5,BlockMap.GrowthAxis.Up);





Functions:


public static BlockMap CreateBlockMap(string mapName, Vector3 tileScale, int chunkWidth, int chunkHeight, BlockMap.GrowthAxis growthAxis);
Create a new Block Map


Parameters:
mapName: The name of your new block map
tileScale: The scale of the tiles within your new blockmap
chunkWidth: The width of the chunks within your new blockmap (Recommend: 5)
chunkHeight: The height of the chunks within your new blockmap (Recommend: 5)
growthAxis: The direction in which your new blockmap will grow when blocks are added to it
Returns BlockMap:Your shiny, new blockmap



public static Block GetEmptyBlock(BlockMap map);
Returns an empty block (useful for deleting blocks but retaining trigger functionality)


Parameters:
map: The map to which this block will be added (required in order to correctly size the trigger of the block)
Returns Returns an empty block

public static void RemoveBlockFromMap(BlockMap map, int x, int y, int depth);
Remove a block from the map (replacing it with an Empty Block)


Parameters:
map: The map from which you wish to remove the block
x: The x coordinate of the block
y: The y coordinate of the block
depth: The depth of the block



public static void RefreshMap(BlockMap map, bool randomise);
Refresh the map - correcting orientations on all blocks


Parameters:
map: The map that you wish to refresh
randomise: Randomise the block variations within the map?



public static void CleanMap(BlockMap map);
Cleans the blockmap - removing all unused variations and orientations


Parameters:
map: The map that you wish to clean



public static Block GetBlockAt(BlockMap map, int x, int y, int depth);
Get the block located at the given coordinates


Parameters:
map: The map from which you wish to retrieve a block
x: The x coordinate of the block
y: The y coordinate of the block
depth: The depth of the block
Returns The block, if one exists, null if not.



public static int GetMapUpperDepth(BlockMap map);
Returns the lowest depth that is populated within the given map


Parameters:
map: The map from which you wish to retrieve the depth
Returns The lowest depth recorded in the map



public static int GetMapLowerDepth(BlockMap map);
Returns the highest depth that is populated within the given map


Parameters:
map: The map from which you wish to retrieve the depth
Returns The highest depth recorded in the map

public static int GetMapHeight(BlockMap map);
Returns the height (in tiles) of the map


Parameters:
map: The map from which you wish to retrieve the height
Returns The height of the map



public static int GetMapWidth(BlockMap map);
Returns the width (in tiles) of the map


Parameters:
map: The map from which you wish to retrieve the width
Returns The width of the map



public static void AddBlockToMap(BlockMap map, Block b, bool randomise, bool refreshUponAddition, int x, int y, int depth);
Add a block to the desired map


Parameters:
map: The map to which you wish to add a block
b: The instantiated Block object that you wish to add to the map (if null, will add an EmptyBlock object)
randomise: Randomise the variant of this Block upon addition to the map?
refreshUponAddition: Refresh the surrounding blocks upon addition to the map?
x: The target x coordinate
y: The target y coordinate
depth: The depth to which to add the block



public static void RefreshBlock(BlockMap map, int x, int y, int depth);
Refresh the target block - correcting the orientation of the block and the surrounding blocks


Parameters:
map: The map housing the block that you wish to refresh
x: The x coordinate of the block to be refreshed
y: The y coordinate of the block to be refreshed
depth: The depth of the block to be refreshed



public static void CleanBlock(BlockMap map, int x, int y, int depth);
Cleans a single block


Parameters:
map: The map containing the target block
x: The x coordinate of the target block
y: The y coordinate of the target block
depth: The depth coordinate of the target block



public static MapChunk GetChunkAtCoordinates(BlockMap map, int x, int y, int depth);
Returns the chunk at the given block coordinates


Parameters:
map: The map from which to retrieve the chunk
x: The block x coordinate
y: The block y coordinate
depth: The depth coordinate
Returns The chunk (if one exists) - null if not



public static Vector3 GetMathematicalPosition(BlockMap map, int x, int y, int depth);
Returns the local position of the given coordinate (useful for character movement


Parameters:
map: The map from which you wish to retrieve the position
x: The block x coordinate
y: The block y coordinate
depth: The block depth coordinate
Returns The local position that is central to this block coordinate



public static Vector3 GetMathematicalCoordinates(BlockMap map, Vector3 localPosition);
Mathematically divine the coordinates of the localPosition provided within the blockmap


Parameters:
map: The map within which you wish to divine your coordinates
localPosition: The local position of the transform (parented to the map)
Returns The x,y,z coordinates of the transform, gathered mathematically. NOTE: This is not of use on a map that involves arbitrarily-placed blocks (e.g soft selection)



Enjoy!

-Joshua McGrath

No comments:

Post a Comment

Disqus for Doppler Interactive Tools