Switching works badly. It can switch, and maybe not. And it depends on the position of the cursor. Although, in the example of Cannon everything works. Why?
local physics = require('physics') physics.start() physics.setDrawMode('hybrid') physics.drawMode ='hybrid' local r=display.newCircle( 200, 200, 200 ) physics.addBody( r,"static") Runtime:addEventListener('key', function(event) local key = event.keyName if event.phase == 'down' then if key == 'd' then if physics.drawMode == 'normal' then physics.setDrawMode('hybrid') physics.drawMode = 'hybrid' elseif physics.drawMode == 'hybrid' then physics.setDrawMode('debug') physics.drawMode = 'debug' else physics.setDrawMode('normal') physics.drawMode = 'normal' end print('draw mode - ' .. physics.drawMode) end end end)