Hey guys
I implemented pinchzoom in my game yesterday but if I zoom my Levelsprite is always zoomed to the upper left corner.
Since there is no setAnchorpoint function available for a sprite I'm kinda stuck. Does anyone know how I zoom where the center of my zoom is in the middle of my both fingers?
Regards
IQ_QI
Comments
http://www.giderosmobile.com/documentation/reference_manual.html#Bitmap:setAnchorPoint
Ultimate Games on Appstore
Ultimate Games on Google Play
Likes: IQ_QI
@thanhquan1512 the link you provide is for Bitmap however in my state and also IQ's its related to sprite
This works fine until you start to rotate the object, which is when everything starts to go turtle.
@twisttap, try a little math and setPosition to get what you want. You can get the Width and Height of the object, you know the final x and Y positions, so now it is as simple as adding or subtracting from these x,y to get the final position.
In fact I am writing an article on this, will post the link here soon.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
http://howto.oz-apps.com/2013/02/positioning-display-objects.html
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
If I set the anchor point every time new if i strat pinchzooming how do i check within my camera file if the viewport bounds are reached ?? and how does it affect my touch point calculation ? ;D
I am sorry for the amount of code i posted but i really cant figure it out how to deal with that pinch zoom ;D
---------------------------------------
http://www.giderosmobile.com/forum/discussion/2715/camera-class-with-kinetics-and-pinch-to-zoom#Item_1
I've since completely rewritten it, but I'm waiting to release a new version until I've been able to really put it through its paces.