object.contentWidth

Type Number
Object DisplayObject
Library display.*
Revision Release 2024.3703
Keywords content width

Overview

The read-only width of the object in content coordinates. This is similar to object.width except that its value is affected by x scaling and rotation.

Example

local rect = display.newRect( 100, 100, 50, 50 )
rect.rotation = 25
rect:setFillColor( 1, 0, 0 )

print( "contentWidth: ".. rect.contentWidth )