Width of the sprite’s current image in pixels. If no image or animation are set it’s the width of the placeholder rectangle.
The default width is 100. All sprite properties can be both accessed and updated.
var sprite = createSprite(200,200); console.log(sprite.width); sprite.width = 200; console.log(sprite.width); drawSprites();
sprite.width
The width of the sprite.
sprite.scale
to resize a sprite and keep the height to width ratio constant.drawSprites()
is called.Found a bug in the documentation? Let us know at documentation@code.org