Closed fjugaldev closed 4 years ago
Hi Fran, there are a couple things going on.
The outline you are showing is for the whole Tile(). To outline the squares you can loop through the tile and outline each child. BUT... as you do, the outline actually gets added to the Tile as a child. So that means for it to work properly, you need to loop through the tile backwards like so: tile.loop(function (item) {item.outline();}, true); BTW - the red circle on the rectangles is the registration point. The + is the origin (0,0) inside the rectangle.
The example uses pos() and the functionality of pos has changed to position the left and top of the object at the position specified or the right and bottom of the object from the right and bottom of the container if you pass in true, true as the next two parameters. So... in short, the loc() method now does what the pos() method did in earlier versions of ZIM and you would want to use loc() to place the registration point.
Once you change to loc() you will see that the center of the ball goes at the center of the rectangle. But that is probably not what you want if you are viewing it isometrically.... but then just add to the loc() values whatever you think looks good.
PS - center(), centerReg() and pos() have been slightly overhauled with respect to adding to containers with no bounds and adding objects with no bounds as of ZIM 10.7.1. See https://zimjs.com/updates.html for more.
Hi,
Im using ZimJS with tag ZIM10 in order to create a isometric world map.
This is my code:
But is not centering the registration point for the tile. In the tagged version ZIM7 is working fine but in the ZIM10 does not.
Its showing like this: view screenshoot Can you tell me what can i do in order to get the registration point in the center of the tile?
Thanks