0 Favourites

r88 Collision Poly and Resize Button

  • Step to reproduce:

    • Create a Sprite
    • Load a texture (I tried with a 256x256)
    • Resize the texture via the resize button (I set it to 32x32)
    • Look a the collision polygon, still covering a 256x256 square.

    Seems weird since I thought collision polygon points were in Texture space. Anyway I had some weird random missing collision because of that.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • This is by design: the collision mask follows the pixels, in accordance to whether you choose align topleft, center or stretch.

    Since if you resize align top-left and just trim off a few pixels, the collision mask should stay exactly where it is so it's still perfectly aligned with the image. If you resize and choose stretch, that's when the collision mask also scales down to fit the image. Do you think it should work differently?

  • Oh I see the resize function does a cropping unless I choose stretch (as it was a noise texture I didn't notice).

    But nonetheless, It's still kinda weird to keep the old big collision poly. Maybe it would be better to add another option that says "scale/trim/don't modify the collision polygon accordingly".

    I think for most case I would scale it. But it would at least make people aware of what the resize will do.

    As we don't see collision polygons by default we might miss the consequence of a resize and come across unexpected bugs.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
37 2,356
fldr's avatar
fldr
Unread hot topic
64 4,529
nimos100's avatar
nimos100
Unread hot topic
36 1,131
Zebbi's avatar
Zebbi