how to get the xScale value of an object?

Hello,

Probably a stupid question and easy solution, so sorry for the question.

I'm using the new Pinch Zoom XL that let us scale and object.
On the lua file that require the pinch zoom XL code, before saving the value into a database, I try to assign to a variable the object.xScale value, but i can't get the new one.
Something like this:

1
2
3
4
5
6
7
8
9
10
11
12
local a=require("scale")
 
...
 
local posx_img,posy_img=img:localToContent(0,0) --Works fine and returns the x,y position, even moving the image img
local sc=img.xScale --Returns allways 1 even scaling the image img
 
....
 
img:addEventListener("touch",a.scale)
 
.....

Anybody could help me, please?
Anyone from Ansca?

wrong forum :) this is feature requests!

anywho, I don't see why that doesn't work.
what is in your scale.lua
the problem is probably in there
:)

Hi, innominata!
Thanks for your reply and sorry for posting in a wrong forum!

My scale.lua file is right the Pinch Zoom XL code, so I think the problem can't be in that file.

I don't know how to get the xScale value...

As I said, I appreciate any help.

I cant see how youve adapted the pinch zoom code, but I'm assuming it doesnt directly scale the object, but adds its to a group, and scales the group

try print( img.parent.xScale,img.parent.yScale )

Hi, innominata!

Thanks a lot! Seems what you said works fine!

Thank you guy!

:) No problem!

views:1828 update:2011/9/17 18:17:57
corona forums © 2003-2011