love.graphics.getStackDepth
Gets the current depth of the transform / state stack (the number of pushes without corresponding pops).
depth = love.graphics.getStackDepth()
depth number The current depth of the transform and state love.graphics stack.