Hi dear friends,
i try to move an bitmapdata with my finger,
when i test it, response is soo late the bitmapdata follow the my finger maybe 0.2 second later
Maybe there is another way to move,
Best regards
i try to move an bitmapdata with my finger,
when i test it, response is soo late the bitmapdata follow the my finger maybe 0.2 second later
B4X:
Dim gv As GameView
gv.Initialize("gv")
Dim touchPad As BitmapData
touchPad.Bitmap=LoadBitmap(File.DirAssets,"touchPad.png")
touchPad.DestRect.Initialize(gaX+wallSize, gaY+wallSize+GetDeviceLayoutValues.Height/2, gaX+wallSize*blockSize, gaY+wallSize*blockSize+GetDeviceLayoutValues.Height/2)
gv.BitmapsData.Add(touchPad)
Dim handler As BitmapData
handler.Bitmap=LoadBitmap(File.DirAssets,"handler.png")
handler.DestRect.Initialize(gaX+gaSize/2-collSize/2, gaY+gaSize/2-collSize/2+GetDeviceLayoutValues.Height/2,gaX+gaSize/2+collSize/2,gaY+gaSize/2+collSize/2+GetDeviceLayoutValues.Height/2)
gv.BitmapsData.Add(handler)
Sub gv_Touch (Action As Int, X As Float, Y As Float)
'check in touchpad
If X>touchPad.DestRect.Left And X<touchPad.DestRect.Right And Y>touchPad.DestRect.Top And Y<touchPad.DestRect.Bottom Then
'Handler touch
If X>handler.DestRect.Left And X<handler.DestRect.Right And Y>handler.DestRect.Top And Y<handler.DestRect.Bottom Then
If Action=0 Then
handlerTouched=True
Else If Action=1 And handlerTouched Then
handlerTouched=False
End If
End If
If Action=2 And handlerTouched Then
handler.DestRect.Left=X-halfSize
handler.DestRect.Top=Y-halfSize
handler.DestRect.Right=X+halfSize
handler.DestRect.Bottom=Y+halfSize
gv.Invalidate
End If
End If
End Sub
Maybe there is another way to move,
Best regards