Good Day!
This thread come related from this last thread: https://www.b4x.com/android/forum/threads/x2-game-wrong-touch-action.135675/
I installed the last versión of B4i, B4A and B4J, and appear some troubles in the compilation, but testing the TOUCHY example, I can solve that in B4A and B4J, but in B4I is not working. Really, I don't know why, because there is same code inside the designer in three programs (B4X Package) and the same code inside the game module. In B4A and B4J works fine the touch action, but in B4i don´t work, and not appear any error. The behavior in my Iphone only run the program, but not work the touch over the tiled escene. The touch action Works fine Over the normal buttons, but not over the tiled when I want to drag some element. This is only happens in B4I. The next are the codes I implemented:
Firs I include the B4XMainPage Module from "Touchy" example.
INSIDE THE CODE DESIGNER:
INSIDE THE GAME MODULE:
I appreciate any orientation!
This thread come related from this last thread: https://www.b4x.com/android/forum/threads/x2-game-wrong-touch-action.135675/
I installed the last versión of B4i, B4A and B4J, and appear some troubles in the compilation, but testing the TOUCHY example, I can solve that in B4A and B4J, but in B4I is not working. Really, I don't know why, because there is same code inside the designer in three programs (B4X Package) and the same code inside the game module. In B4A and B4J works fine the touch action, but in B4i don´t work, and not appear any error. The behavior in my Iphone only run the program, but not work the touch over the tiled escene. The touch action Works fine Over the normal buttons, but not over the tiled when I want to drag some element. This is only happens in B4I. The next are the codes I implemented:
Firs I include the B4XMainPage Module from "Touchy" example.
INSIDE THE CODE DESIGNER:
B4X:
'All variants script
GameRatio = 1.888 'width / height
ScreenRatio = 100%x / 100%y
If ScreenRatio < GameRatio Then
ivForeground.SetLeftAndRight(0, 100%x)
ivForeground.Height = ivForeground.Width / GameRatio
ivForeground.VerticalCenter = 50%y
Else
ivForeground.SetTopAndBottom(0, 100%y)
ivForeground.Width = ivForeground.Height * GameRatio
ivForeground.HorizontalCenter = 50%x
End If
ivBackground.SetLeftAndRight(ivForeground.Left, ivForeground.Right)
ivBackground.SetTopAndBottom(ivForeground.Top, ivForeground.Bottom)
PanelForTouch.SetLeftAndRight(ivForeground.Left, ivForeground.Right)
PanelForTouch.SetTopAndBottom(ivForeground.Top, ivForeground.Bottom)
INSIDE THE GAME MODULE:
B4X:
#If B4J
Private Sub Panel_Touch (Action As Int, X As Float, Y As Float)
'Multitouch.B4JDelegateTouchEvent(Sender, Action, X, Y)
End Sub
#Else If B4i
Private Sub Panel_Multitouch (Stage As Int, Data As Object)
Multitouch.B4iDelegateMultitouchEvent(Sender, Stage, Data)
End Sub
#End If
I appreciate any orientation!