Games [XUI2D] debug texts

LucaMs

Expert
Licensed User
Although this line is commented:
B4X:
'    X2.EnableDebugDraw
and I have compiled in Release (obfuscated) mode I continue to see the FPS, Bodies, etc. at the bottom of the screen.
 

LucaMs

Expert
Licensed User
X2Utils.bas:
B4X:
If mGame.lblStats.IsInitialized And mGame.lblStats.Visible Then
   Dim Stats As String = $"FPS: ${NumberFormat(FPS, 0, 0)}, Time: ${ConvertMillisecondsToString(gs.GameTimeMs)}"$
   Stats = Stats & $", Bodies: ${AllBodies.Size}, ScreenAABB: ($1.1{ScreenAABB.BottomLeft.X},$1.1{ScreenAABB.BottomLeft.Y})-($1.1{ScreenAABB.TopRight.X},$1.1{ScreenAABB.TopRight.Y})"$
   If IsDebugDrawEnabled Then
       Stats = Stats & ", DebugDraw!"
   End If
#if debug
   Stats = "DEBUG MODE! " & Stats
#End If
   mGame.lblStats.Text = Stats
End If
This one?
 

LucaMs

Expert
Licensed User
X2BodyWrapper.bas
B4X:
'Deletes the body.
Public Sub Delete (GS As X2GameStep)
   If IsDeleted Then Return
   #if Not (X2SkipLogs)
   Log($"Deleting body: ${Name}, ${Id}"$)
   #end if
   IsDeleted = True
   GS.BodiesToDelete.Add(Body)
   If mGraphicName.StartsWith(X2.GraphicCache.TempPrefix) Then
       X2.GraphicCache.RemoveGraphics(mGraphicName)
   End If
End Sub
also "not on screen" (normal) logs are printed
 

DonManfred

Expert
Licensed User
You are free to edit it

Try
B4X:
   #if debug and Not (X2SkipLogs)
   Log($"Deleting body: ${Name}, ${Id}"$)
   #end if
 

DonManfred

Expert
Licensed User
You can create a thread in the wishforum. Or just write your own classes.
I just showed a way to get around it. Sure it is only for you.
 
Top