How can I scale an image up at the coordinates the screen is touched?
I’ve tried without success to modify the reference point using event x,y,then scaling. [import]uid: 31039 topic_id: 9408 reply_id: 309408[/import]
How can I scale an image up at the coordinates the screen is touched?
I’ve tried without success to modify the reference point using event x,y,then scaling. [import]uid: 31039 topic_id: 9408 reply_id: 309408[/import]
You need a reference to the object in order to scale it. You can get the reference by creating a table “touch” listener for each object and use event.target along with the object:scale() API.
You can also create a table of all the objects created and determine which object was touched in a global Runtime “touch” event listener.
You can only scale the entire image/object and not a portion of the object. [import]uid: 7559 topic_id: 9408 reply_id: 34869[/import]
@Tom
Thanks for your response.
It is the entire image I want to scale, just at the point it’s touched.
I’ve tried without success to change the image origin to the touch coordinates, then scale up.
I haven’t put the image into a table, so I’ll try that next per your suggestion.
Meanwhile, Carlos is looking for some code he believes will demonstrate how it’s done. [import]uid: 31039 topic_id: 9408 reply_id: 34875[/import]
@Tom
I noticed given the same code, if I scale around a display object without inserting it into a group it doesn’t scale around the touch. If I put the object in a group it does.
Why? [import]uid: 31039 topic_id: 9408 reply_id: 44415[/import]