This site requires JavaScript, please enable it in your browser!
Greenfoot back
actinium
actinium wrote ...

2011/9/15

Tile positions.

actinium actinium

2011/9/15

#
I have a problem with adding actors to my world. I am trying to make a tilled word with tiles 50 pixels x 50 pixels. The images are placed into the world correctly from the world subclass, my problem is when i try to place an actor into the world it appears at unexpected coordinates in relation to my tiles. I am using the addObject method, even when i draw my own 50 x 50 image for my actor the actor wont play ball position wise. Anyone got any info on the way addObject x,y coords work and why my actors are out of position.
GameCode GameCode

2011/9/15

#
The 0,0 coordinate is at the top-left corner! So its like this: 0 1 2 3 4 5 6 7 ... 1 2 3 4 5 6 ...
actinium actinium

2011/9/15

#
Thanks for your reply. I know that the coordinates are 0,0 top left. Wait a minute, if i addObject at 0,0 its actually the centre of the image, while a tile at 0,0 is at the top left. Lol, i need an offset of 12.5 for x and y coords in addObject, got it thanks.
You need to login to post a reply.