Miscellaneous things about LÖVE
love.graphics.push "all" — Very useful for doing temporary draw operations. This saves you a lot of wasted time restoring changes to translation, color, shaders, render targets (canvas) etc.
love.graphics.inverseTransformPoint(screenX, screenY)
— Converts a point from screen space into the current transformation space. Extremely useful for things like figuring out where the mouse position within the game world.
love.graphics.setBlendMode(mode, alphamode)
— useful for making drawing things by setting blend mode to "replace". This allows you to turn a draw operation into a very simple eraser by drawing with transperant objects or primitives.
love.keyboard.isScancodeDown(code) — This is what you want for locale independent immediate mode key checking. Made the mistake of using love.keyboard.isDown(key)
- In LÖVE 12, the mouse position is now a floating point value. This can cause algorithms that expect integers to fail (such as Bresenham's line algorithm).
love_ScreenSize — this shader parameter contains the screensize. However, it's a vec4 so you'll need to explicitly access the xy field.