myObject.height = 250 not working

I’m trying to change the width and height of an object in a transformation but can’t seem to get height to work.

myObject.width = 350

works but

myObject.height = 250

does not. Neither does

transition.to( myObject, { x=400, y=540, width=900, height=1200, time=1000, delay=0 } )

Any idea what I’m doing wrong? [import]uid: 6397 topic_id: 1862 reply_id: 301862[/import]

Is height capitalized?

Or more specifically the ‘H’ - I had that one before… [import]uid: 8485 topic_id: 1862 reply_id: 5479[/import]

Changing the case of the first letter to caps for Height didn’t seem to make a difference and made Width no longer work. [import]uid: 6397 topic_id: 1862 reply_id: 5481[/import]

Still can’t get object.height to work, object width works fine, is this a bug? Also I tried using object.scale(.5, .5). This seems to permanently change the scale of the object so I can’t show it larger. Is there a way to restore it to it’s original size? [import]uid: 6397 topic_id: 1862 reply_id: 5571[/import]

It depends what kind of object you’re trying to manipulate. For example, you cannot change the height of a newText object. For everything else you should be able to change with myObject.height = 450

You may also want to look at your object.stageHeight. That may different than object.height depending on your config.lua settings.

Here is an example of a working height transition project:

-- main.lua  
  
local box1Width = 100  
local box1Height = 100  
  
local text1 = display.newText("height test", 0, 40, "Courier", 20)  
text1:setTextColor(255, 255, 255, 255)  
text1.x = display.viewableContentWidth/2  
  
local box1 = display.newRect(0, 0, box1Width, box1Height)  
box1:setFillColor(0, 200, 200, 255)  
box1.x = display.viewableContentWidth/2; box1.y = display.viewableContentHeight/2  
  
function growBox( event )  
 local t = event.target  
 local phase = event.phase  
  
 if "ended" == phase then  
 -- transition.to( t, { time=1000, width=t.width\*2, height=t.height\*2 } )  
 transition.to( t, { time=1000, height=t.height\*2 } )  
 end  
end  
box1:addEventListener( "touch", growBox )  
text1:addEventListener( "touch", growBox )  

[code]
– config.lua

application =
{
content =
{
width = 320,
height = 480,
scale = “zoomEven”
},
}
[/code] [import]uid: 8194 topic_id: 1862 reply_id: 5674[/import]