federoldan Posted May 29, 2023 Share Posted May 29, 2023 Hello, first of all I want to clarify that I've already read this post. My problem is very similar but not the same. Also, there isn't a solution in that thread. Wich is my problem? So, I render a bunch of Sprites in the map using a regular PIXI.Container. So far so good, there is no problem there. When I zoom in, the scale of the sprites gets to little and all of those sprites who aren't beeing focused dissapear when zooming out. I would like to be able to zoom in and out without problems and use the scale property the right way I hope I made myself clear. This is my code for the Sprite creation. And this is function is for the zoom wich is called as a callback of the creation of the pixiOverlay (it executes every time there is an event in the map, such as: creation, zoom in, zoom out, etc) Quote Link to comment Share on other sites More sharing options...
federoldan Posted May 30, 2023 Author Share Posted May 30, 2023 I've found a solution! Obviously, it was an scale issue. I still dont't figured out how does scale works but the solution is this: I set the scale of the sprite equal to the current pixi overlay instance using the map zoom as argument and the dividing it by 16 (sprite size): And when zooming in or out I set the scale as it follows: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.