A The Binding of Isaac: Repentance modding library, that was made primarily for manipulating the game camera's position without REPENTOGON. But it also adds various useful features even with REPENTOGON installed.
Tested on Repentance v1.7.9b.J835 (with and without REPENTOGON v1.0.12e) and on Repentance+ v1.9.7.12.J273
- Get current camera position
- Change camera position
- Make camera follow specific entity
- Remove camera movement limits from the base game
CameraAPI uses invisible Hush entity to manipulate all camera movements. It works because when Hush's NpcState is equal to NpcState.STATE_APPEAR_CUSTOM(2) the game automatically snaps camera position to it's position. All you have to do is to spawn this invisible entity on first update and make it persistent between rooms.
CameraMode.FREE works by adding FLAG_NO_WALLS to RoomDescriptor entry. In that case room borders limit is disabled only for camera and projectiles(for some reason).
To be able to use CameraAPI you simply need to
- Download latest release from Releases page
- Place
camerapi.luafile anywhere in your mod - Require the lib in your main.lua file and attach it to a variable
local CameraAPI = require("scripts.utils.camerapi")- Initialize the lib ONCE for callback registry
CameraAPI:Init(YourModVariable)Congratulations! Now you can use any lib functions as you wish. Check the wiki for detailed info.
No, there are no actual limits. However, I must say, that with active camera option enabled camera movements will be MUCH slower. I've already implemented auto-disabling it on camera init, but if you for whatever reason want to remove this feature, you can delete the corresponding code(other CameraAPI instances will just disable it anyway).