Problem with bounding box of sprite

Please take a look at the following program.

I am wondering why the ball never reaches the edges of the stage. I have used the following conditions:

  • if my left < left of Stage
  • if my right > right of Stage
  • if my top > top of Stage

My expectation was, that it should exceed the border of the stage at least by one pixel. But it does not seem to work.

image
so i did some tests and it seems that the costume has invisibles pixels (the red dot shows where is the top of the costume)

Something strange is going on in the project
In a new project with one of the ball costumes everything looks correct

image

but even with same costume in OP project, things are not correct
image

@ceving This is my better solution to your problem, is only for balls.
Captura de Pantalla 2024-02-23 a la(s) 16.15.31.p. m.

It seams like it's actually due to the current rotation.

Here's some of my tests
image
image
image
image

I think I know what's happening, it's not invisible pixels, it's just that snap doesn't calculate the pixel at the edge, it just looks at the width and height of the current costume.

Since your ball costume is symmetrical on all sides (there is no visual difference in different rotations), you can set the rotation style to "don't rotate"
image

Which will make sure the bounding box is calculated correctly.
image
image

Not looking for an alternative solution - we are looking for why this is happening in this project

ahh - well spotted :slight_smile:

Thanks! That option helps a lot. I thought I had to create a point-symmetric ball. But with this option it is possible to put the light source in the correct position.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.