Object width and height

Hi,

I am working on corona SDK for a game. I need the width and height of an scaled object. These objects are images, whenever I try to get the width of any object, I get the actual pixels value of the object.

Can anyone tell me how can I get the width and height of object after applying the scaling. [import]uid: 176766 topic_id: 33055 reply_id: 333055[/import]

width * scale

example

300px * .5 = 150pixels

Joakim [import]uid: 81188 topic_id: 33055 reply_id: 131268[/import]

Thank you! [import]uid: 176766 topic_id: 33055 reply_id: 131272[/import]

width * scale

example

300px * .5 = 150pixels

Joakim [import]uid: 81188 topic_id: 33055 reply_id: 131268[/import]

Thank you! [import]uid: 176766 topic_id: 33055 reply_id: 131272[/import]

Are you looking for the size in pixels? Pixels are quite useless, more often you will be interested in the size in corona units. (the size of these units in pixels depends on the view size you have in config.lua) But roughly speaking, usually you’ll have a view of 320x480 units and any object you load has the object.contentWidth and object.contentHeight properties which represent the actual size in Corona units. So if you’ve scale, rotated, or anything else that would be reflected in these properties. [import]uid: 80469 topic_id: 33055 reply_id: 131318[/import]

Are you looking for the size in pixels? Pixels are quite useless, more often you will be interested in the size in corona units. (the size of these units in pixels depends on the view size you have in config.lua) But roughly speaking, usually you’ll have a view of 320x480 units and any object you load has the object.contentWidth and object.contentHeight properties which represent the actual size in Corona units. So if you’ve scale, rotated, or anything else that would be reflected in these properties. [import]uid: 80469 topic_id: 33055 reply_id: 131318[/import]