Games [XUI2D] debug texts

LucaMs

Expert
Licensed User
Longtime 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?
 

DonManfred

Expert
Licensed User
Longtime User
Looks like, yes. Change it and try again...
 

LucaMs

Expert
Licensed User
Longtime 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
 
Top