These docs are *very* out of date.
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
object.height
Description:
Retrieve or change the height of a display object. It's possible to use this to set the height of objects, with the exception of text objects.
For images, the returned parameter is the original bit map height
This parameter is unaffected by object:scale() or object.yScale. (See object.contentHeight.)
Syntax:
local var = object.height object.height = value
Example:

local rect1 = display.newRect(100, 100, 50, 50) rect1:setFillColor(170, 170, 170) local rect2 = display.newRect(100, 100, 50, 50) rect2:setFillColor(255, 255, 255) rect2.y = rect1.y + rect1.height + 1
Returns:
number: Height value of the object.
Remarks:
The value is not affected by object scaling or rotation.
Note: Setting a new height or width of a display object will always expand or shrink the object from the center no matter what display.setReferencePoint value is set. Case #677/1222
Supported on operating systems and platforms for build numbers shown:
- Mac OS X:Corona SDK 1.0
- Windows:Corona SDK 2.0
- iOS:Corona SDK 1.0
- Android:Corona SDK 2.0
Replies
Posted on Tue, 2011-05-24 06:30
#2
The height and width of a group is determined by the objects in the group. You can read the group's height and width but can't set it directly.
It seems like it's also not possible to set the width/height of Groups either.