Games [XUI2D] x2.WorldPointToMainBC is there a x2.MainBCToWorldPoint?

Erel

Administrator
Staff member
Licensed User
You are probably looking for ScreenPointToWorld.

Example from one of the projects:
B4X:
Sub PanelForTouch_Touch (Action As Int, X As Float, Y As Float)
   If Action = PanelForTouch.TOUCH_ACTION_DOWN Or Action = PanelForTouch.TOUCH_ACTION_MOVE Then
       For Each bw As X2BodyWrapper In X2.GetBodiesIntersectingWithWorldPoint(X2.ScreenPointToWorld(X, Y))
           If bw.Name = "car" Then
               'never do physcial stuff from the Touch event. Only from inside the game loop
               X2.AddFutureTask(Me, "car_touched", 0, "")
           End If
       Next
   End If
End Sub
 
Top