object.height

Type Number
Object DisplayObject
Library display.*
Revision 2017.3060
Keywords object, height, size
See also object.contentHeight
object.width

Overview

Retrieve or change the height of a display object. For text objects, this property can be used to get (but not set) the height.

For images, the returned value is the original bitmap height, including any transparent area.

Gotchas

This value is unaffected by object:scale() or object.yScale. Likewise, the value is not affected by object rotation.

Example

local rect1 = display.newRect( 100, 100, 50, 50 )
rect1:setFillColor( 0.5, 0, 1 )
 
local rect2 = display.newRect( 100, 100, 50, 50 )
rect2:setFillColor( 1, 0, 0 )
rect2.y = rect1.y + rect1.height+10

local rect3 = display.newRect( 150, 75, 50, 50 )
rect3:setFillColor( 0, 0.5, 1 )
rect3.anchorY = 0

transition.to( rect3, { time=2000, height=110 } )