Jump to content

Another scale problem with collisions


Faramix
 Share

Recommended Posts

Hi ,

I got 1 problem with my game, I would like to make it responsive and able to resize for each screen.

The fact is that i developed it in 1920*1080 in order to just resize all in one. But I figured out that i can't do that and i needed to resize the phaser screen and after all the sprites inside. It's not really hard to do that so far I used the scale.set function to resize the sprite depending on the window. The problem is that the collisions aren't updated i think because I can't pass where I could before. I searched solutions but couldn't find one for me, indeed the setScale function doesn't work for me. Moreover I put all my sprites in groups, I don't know it it interfers .

Thanks for your help (and sorry for mistakes )

Link to comment
Share on other sites

If you're using tilemaps, you have to use TilemapLayer#setScale to scale the collision edges correctly.

If you're using Arcade Physics, you have to avoid scaling Groups (or World) and instead scale every sprite individually.

But the simplest way is to avoid all of that and just use scaleMode SHOW_ALL etc.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...