You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is useful for debugging, when users want to see the result of love.graphics.getStats() of their game without Slab stats mixing in the result (this happens when you draw the stats inside of a Slab window.
Usage would be (i think):
localstats=love.graphics.getStats()
localslab_stats=Slab.GetStats()
print(stats.drawcalls-slab_stats.drawcalls) --get the drawcalls stats without Slab mixed in
The text was updated successfully, but these errors were encountered:
Here is an example of how to use this new feature:
functionlove.load(args)
Slab.Initialize(args)
Slab.EnableStats(true) --importantendfunctionlove.update(dt)
Slab.Update(dt)
show=Slab.BeginWindow("test", {Title="Test"})
Slab.Text("test")
Slab.Text("test")
Slab.Text("test")
Slab.Text("test")
Slab.Text("test")
Slab.Button("test")
Slab.EndWindow()
endlocalt= {}
functionlove.draw()
--this will be not included in the Slab stats--any drawing called before Slab.draw call will not be included in the Slab statslove.graphics.print("test0", 256, 120)
Slab.Draw()
--get the stats used by Slab if you want to do anything with it--this will not include the printed "test0" earlier since it's outside of Slab (before Slab.Draw call)locald=Slab.GetStats()
--draw more stuff (these are batched by love)--drawings after Slab.Draw are also not included in Slab statslove.graphics.print("test1", 256, 128)
love.graphics.print("test2", 256, 134)
love.graphics.print("test3", 256, 140)
love.graphics.print("test4", 256, 146)
--get the stats (this includes the Slab stats)t=love.graphics.getStats(t)
--this will calculate the love stats (exclude Slab stats)t=Slab.CalculateStats(t)
--draw to the screen to see the resultlocali=0fork, vinpairs(t) dolove.graphics.print(k.." = " ..v, 32, i*32)
i=i+1endend
This is useful for debugging, when users want to see the result of
love.graphics.getStats()
of their game without Slab stats mixing in the result (this happens when you draw the stats inside of a Slab window.Usage would be (i think):
The text was updated successfully, but these errors were encountered: