The real height (or Width) of a rotated sprite


maybe can’t be done, but:

i need to know the real height of a rotated sprite. if i call “object.height()” its true only with non rotated objects… but sizes changes when objects are rotated. i don’t want to make it with pitagora. maybe there is a shotcut???

… i just want to place a text under my ships in space, but those ships 360° rotate.

thanks, Ermes

To clarify: An object’s height doesn’t change when you rotate the object. Height is always the object’s actual height, not “visual respresentation” height.

You could probably compare the object’s origin point (Object.PointY(“Origin”)) vs its center point (Object.PointY(“Center”)) and multiply the result by 2, I guess? (Center-Origin)*2. That should be accurate as the points do rotate when rotating an object.

1 Like

!!! Very clever tought, i’m amazed. it can really works.

:slight_smile: i’m used to be smart enough, but not this time…



Editet: a modify to this technique.
you need three points instead of two: centre, topleft and topright. the real height/2 is the biggest value you get between with the subtraction:

abs(centre - topleft) and abs(centre - topright).

multiply x 2 and you get the real height. nice.

1 Like