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:

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)  
  
.....  
  

I appreciate any help.

Thanks in advance! [import]uid: 44013 topic_id: 11861 reply_id: 311861[/import]

Anybody could help me, please?
Anyone from Ansca? [import]uid: 44013 topic_id: 11861 reply_id: 43440[/import]

wrong forum :slight_smile: 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
:slight_smile:
[import]uid: 34945 topic_id: 11861 reply_id: 46209[/import]

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. [import]uid: 44013 topic_id: 11861 reply_id: 47349[/import]

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 )
[import]uid: 34945 topic_id: 11861 reply_id: 47373[/import]

Hi, innominata!

Thanks a lot! Seems what you said works fine!

Thank you guy! [import]uid: 44013 topic_id: 11861 reply_id: 47850[/import]

:slight_smile: No problem!
[import]uid: 34945 topic_id: 11861 reply_id: 48009[/import]