Skip to content

getWidth()

Return the object's width.

This is the object's own width before rotation, so it stays the same as the object rotates. For the width of the upright box around the rotated object, use getBoundingWidth().

Parameters

Once an object item has been created, you can use the following function:

item.getWidth()

Returns

return width

Value Type Description
width int or float The width, in pixels.