The scaled height of the sprite's current image in pixels. If no image or animation are set, it’s the scaled height of the placeholder rectangle.
sprite.scale property can be used to scale a sprite larger or smaller and keep the height to width ratio constant. For some games or animations you may need to know the actual height of the scaled sprite in pixels.
var sprite = createSprite(200, 200); sprite.scale=0.75; drawSprites(); console.log(sprite.width); console.log(sprite.height); console.log(sprite.getScaledWidth()); console.log(sprite.getScaledHeight());
The scaled height of the sprite.
sprite.heightare not changed. Use
setCollider()is called for a sprite before it is scaled, the collider is not scaled. But if a sprite is first scaled and then the collider set, the scale is also applied to the collider.
Found a bug in the documentation? Let us know at email@example.com