Android Question Touch screen pressed position

ocalle

Active Member
Licensed User
Longtime User
Expect that be useful for something, showing my code


Sub Globals
Private ppanel As Panel
Private x1,y1 As Float
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub


Sub ppanel_Touch (Action As Int, X As Float, Y As Float)
Select Action

Case Activity.ACTION_MOVE
ToastMessageShow("Touched",False)
Log(X&Y)
End Select
End Sub
 

anOparator

Active Member
Licensed User
Longtime User
This is great, and a different approach.
I changed the Action to:
B4X:
Case Activity.ACTION_TOUCH
ToastMessageShow("Touched",False)
x1 =X
y1 =Y
Log(X&Y)
End Select
Has anyone ever changed this x1,y Float into a View by clicking the TopLeft, TopRight. Bottom Right, and Bottom Left corners of any portion of Panel1.Background?
Will post sample code soon.
edit: nvm, Im going to use an image map.
 
Last edited:
Upvote 0
Top