Have the viewport follow a level's area, as it does a Tiled map's: its
bounds are the area's (or its own size where the area is smaller), and
an area smaller than the viewport is centred in it, now and each time
the viewport is resized. For the addTo of a format registered with
level.registerFormat.
A viewport follows one level at a time: following another replaces the
first. Call the function returned from the level's destroy.
// in a level's addTo(container, options) if (options.setViewportBounds !== false) { constarea = newBounds(); area.setMinMax(0, 0, this.width, this.height); this.unfollow = level.followViewport(container, area); } // and in its destroy() this.unfollow?.();
Have the viewport follow a level's area, as it does a Tiled map's: its bounds are the area's (or its own size where the area is smaller), and an area smaller than the viewport is centred in it, now and each time the viewport is resized. For the
addToof a format registered with level.registerFormat.A viewport follows one level at a time: following another replaces the first. Call the function returned from the level's
destroy.