Setstatictile
by Gavin Beard · in Torque Game Builder · 03/24/2005 (3:52 am) · 4 replies
Okey pokey :S
whilst i'm reworking code i'm having a go at movement, the first thing i'm doing is creating a blank tile layer, and just to test it setting up 1 tile in that layer here is the code:
$lvlMap = new fxTileMap2D() { scenegraph = t2dSceneGraph; };
$lvlMap.loadTileMap("~/client/maps/lvl" @ %levelNum @ ".map");
//Empty layer
$moveMap = $lvlMap.createTileLayer("21 18 4 4");
$movemap.Setposition("-8 0");
$movemap.setStaticTile("5 5",highlight);
now for all the other layers lvlMap works fine, this new layer is created just fine in as much as i can do a dump and get all the commands and i can call the functions of it and they seem to execute ok. i know the datablocki 'highlight' is ok as i can draw it as a sprtie, but for the life of me it will not display in the layer i have made, i can turn all other sprites/tile layers off and it still does not work......n e ideas what is wrong with that code?
*edit - dunno if it helps but if i do echo($movemap.setStaticTile("5 5",highlight)); it returns 1 to the console
whilst i'm reworking code i'm having a go at movement, the first thing i'm doing is creating a blank tile layer, and just to test it setting up 1 tile in that layer here is the code:
$lvlMap = new fxTileMap2D() { scenegraph = t2dSceneGraph; };
$lvlMap.loadTileMap("~/client/maps/lvl" @ %levelNum @ ".map");
//Empty layer
$moveMap = $lvlMap.createTileLayer("21 18 4 4");
$movemap.Setposition("-8 0");
$movemap.setStaticTile("5 5",highlight);
now for all the other layers lvlMap works fine, this new layer is created just fine in as much as i can do a dump and get all the commands and i can call the functions of it and they seem to execute ok. i know the datablocki 'highlight' is ok as i can draw it as a sprtie, but for the life of me it will not display in the layer i have made, i can turn all other sprites/tile layers off and it still does not work......n e ideas what is wrong with that code?
*edit - dunno if it helps but if i do echo($movemap.setStaticTile("5 5",highlight)); it returns 1 to the console
#2
i think i missed it out coz i didnt need to do it for my other 2 maps
03/24/2005 (4:19 am)
So if its a 21 x 18 map with 4 x 4 tiles easy thing to do is (21 x 4 by 18 x 4)or size???i think i missed it out coz i didnt need to do it for my other 2 maps
#3
No rules, it's up to you. You can have a small window and scroll your tilemap is that's what you want to do or have a large window to show all your tiles.
The tile-layers only show tiles within the fxTileLayer2D window so you need to set it to what you want.
Totally up to you. :)
- Melv.
03/24/2005 (6:07 am)
Gavin,No rules, it's up to you. You can have a small window and scroll your tilemap is that's what you want to do or have a large window to show all your tiles.
The tile-layers only show tiles within the fxTileLayer2D window so you need to set it to what you want.
Totally up to you. :)
- Melv.
#4
cheers melv
just as an update i think imma try to use a* path finding, woo...looks damn hard, lol
03/24/2005 (3:09 pm)
Sorry i ment so that it fitted in with the rest of my tile layers created in the tile editor, it worked just as expected ;) so now i star the path finding, update u all in a year or 2 :Dcheers melv
just as an update i think imma try to use a* path finding, woo...looks damn hard, lol
Associate Melv May
The size would have to be at least (4*6 by 4*6) to see it. 6 = position 5 as it's zero-based so 5 is the 6th tile.
- Melv.