Hi, I've made an app using AGK2 which is available on google play store, it's doing quite well, nearly 50,000 installations. A lot of the feedback on the reviews says that they are having problems with the edit photo screen - in the game you take a picture of yourself or a friend and that becomes a virtual pet. I've tested the code on my tablet and it works perfectly but when I just tested it on a phone the image disappears if you touch it twice. I need the user to drag a sprite containing a photo around the screen in order to position it correctly.
This is the code I have, all variables are listed as global.
hold = user holding down with finger, photox and photoy is the size of the photo. px2# and py2# are the old positions of the photo before holding.
'get position of photo
if hold=0 and click=0
px2#=getspritex(1)
py2#=getspritey(1)
endif
'move photo
if hold=1 and getpointery()<1000
px#=getpointerx()-photox/2
py#=getpointery()-photoy/2
setspriteposition(1,px2#+px#,py2#+py#)
endif
It seems that whenever I double tap the screen the sprite disappears
Why does it work on my tablet but not my phone?
Any help would be much appreciated, or if you know a better way of doing it then let me know!
Thanks
UPDATE!
I managed to fix it using this code, knew it would be something easy!
if getpointerstate()=1
sx#=getspritewidth(1)/2
sy#=getspriteheight(1)/2
setspriteposition(1,getpointerx()-sx#,getpointery()-sy#)
endif
I was using the photo size instead of the sprite size
www.liambradburymusic.com - professional music for your games.