r88 Collision Poly and Resize Button

Bugs will be moved here once resolved.

Post » Fri May 04, 2012 10:42 am

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.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu May 17, 2012 1:53 pm

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?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu May 17, 2012 7:13 pm

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.Yann2012-05-17 19:14:08
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest