Adding or creating images datablocks.
by Matthews_30 · in Torque Game Builder · 12/10/2005 (7:10 am) · 4 replies
Working with datablocks is not easy, specially when trying to add new images, tiles to a map.
i took the plattformer tutorial, then try to add a new background (montana.png) wich is a mountain, and added the following:
// --------------------------------------------------------------------
// TileMap ImageMap.
// --------------------------------------------------------------------
datablock fxImageMapDatablock2D(tileMapImageMap)
{
mode = cell;
cellWidth = 128;
cellHeight = 128;
textureName = "~/media/imagenes/tileMap";
};
datablock fxImageMapDataBlock(montana)
{
mode=cell;
cellWidth=1152;
cellHeight=854;
textureName="~/media/imagenes/montana";
};
and i copy my image file in "~/media/imagenes/" it is not appearing in the TileMap editor.
tileMap image (the one who comes with the plattformer works ok) it is in the same directory that my custom image.
any idea?
i took the plattformer tutorial, then try to add a new background (montana.png) wich is a mountain, and added the following:
// --------------------------------------------------------------------
// TileMap ImageMap.
// --------------------------------------------------------------------
datablock fxImageMapDatablock2D(tileMapImageMap)
{
mode = cell;
cellWidth = 128;
cellHeight = 128;
textureName = "~/media/imagenes/tileMap";
};
datablock fxImageMapDataBlock(montana)
{
mode=cell;
cellWidth=1152;
cellHeight=854;
textureName="~/media/imagenes/montana";
};
and i copy my image file in "~/media/imagenes/" it is not appearing in the TileMap editor.
tileMap image (the one who comes with the plattformer works ok) it is in the same directory that my custom image.
any idea?
#3
Also, the alpha uses different field names; "mode" and "textureName" don't exist. Have a look at the image-map PDF documentation for more info.
- Melv.
12/10/2005 (12:12 pm)
I noticed that your cells widths are 1152/854. Are your cells that big? If this is a single full-frame image then simply use "FULL" mode.Also, the alpha uses different field names; "mode" and "textureName" don't exist. Have a look at the image-map PDF documentation for more info.
- Melv.
#4
12/10/2005 (8:19 pm)
Ok, Melv, many thanks!
Torque 3D Owner Tom Ogburn
Starlit Sky Games
datablock fxImageMapDataBlock2D(montana) if you are using 1.0.2
or
datablock t2dImageMapDatablock(montana) if you are using 1.1 alpha