amaccann / phaser-navmesh-generation

12 stars 1 forks source link

addSprite uses pixels instead of tile units #25

Closed jorbascrumps closed 3 years ago

jorbascrumps commented 3 years ago

The documentation specifies that the width and height arguments of addSprite are expressed as tile units. I took this to mean that if I wanted to add a sprite that's a single tile in size then I would pass 1,1 to the function; however it appears that the function actually expects a size in pixels (32,32 - or whatever your tile size is).

The intention is probably to use pixel values as then you can add arbitrary sprites that don't adhere to the grid.

I know that work is ongoing with the v3 version of the plugin and this is likely hangover from the old version so I guess this is just a note to update the docs when the time comes.

amaccann commented 3 years ago

Good catch: I'll update the docs to reflect this; yes, it should be spriteWidth and spriteHeight in pixels

amaccann commented 3 years ago

@jorbascrumps FYI, I've made the Phaser 3 repo public now; so if you have any further feedback, you can add it there https://github.com/amaccann/phaser3-plugins

amaccann commented 3 years ago

I've also updated the documentation for addSprite to reflect the correct parameter description(s)