I read the question i posted here
and i think i complicated the explanation so i will try again by using sample of my code.
Can a moderator please delete my previous question? i did not see an option to do so myself…
I have been trying a few things and maybe i am getting somewhere.
What i need to know is how to detect which item has been touched??
I have read this article http://docs.coronalabs.com/guide/events/detectEvents/index.html but i didn’t manage to do it…
Any help?
Lets say i have a button named arrow
arrow=display.newImage("arrow.png") arrow.x = \_W\*0.5 arrow.y = \_H-50 arrow:rotate( 180 ) screenGroup:insert( arrow )
when this is touched another item named myRoundedRect pops up as a menu
myRoundedRect = display.newRoundedRect(0, 0, arrow.contentWidth, arrow.contentHeight, 12 ) myRoundedRect.x=\_W\*0.2 myRoundedRect.y= \_H\*0.5 myRoundedRect.strokeWidth = 3 myRoundedRect:setFillColor(0, 0, 0) myRoundedRect:setStrokeColor(180, 180, 180) myRoundedRect.isVisible = false screenGroup:insert( myRoundedRect )
What i want to do is to detect which button is touched by the
user (in this case the arrow) and then take its .x and .y and place them
as attributes to myRoundedRect. Something like that:
myRoundedRect = display.newRoundedRect(0, 0, TOUCHED BUTTON.contentWidth, TOUCHED BUTTON.contentHeight, 12 )