roomcameraplugin
render2d's camera in a world cut into rooms.
Putting it in a scene
List it after render2d. It has no settings. An actor calls look every frame in its tick with the point to follow and the room that point is in.
"plugins": ["loader", "scenemanager", "player", "render2d", "roomcamera"]
plugins.roomcamera.look(plugins, row.pos, [0, 0, 20, 12])
Methods
On the page, through plugins.roomcamera.
look( plugins, at, room, from?, through = 1 )
Points render2d's camera at at, kept far enough inside room that nothing past the room's edges is shown. Along an axis where the room is no bigger than the view, the camera sits at the room's middle instead. The view's size comes from the canvas size and render2d's zoom.
room is [x, y, w, h] in world units: the corner with the lowest x and y, and the size.
To scroll from one room to the next as a character walks between them, also pass the room it came from as from and how far through the walk it is as through, from 0 to 1. The camera moves that far from where it was held in from to where it is held in room.
It works for a flat world, one whose ground lays x across the screen and y up or down it.