added documentation for Focusable Zones

This commit is contained in:
Hanusiak Piotr 2021-12-14 12:03:05 +01:00
parent 0f1378c069
commit 960c247b20
15 changed files with 101 additions and 31 deletions

View file

@ -793,7 +793,10 @@ export class GameScene extends DirtyScene {
const focusable = zone.properties?.find((property) => property.name === "focusable");
if (focusable && focusable.value === true) {
const zoomMargin = zone.properties?.find((property) => property.name === "zoom_margin");
this.cameraManager.enterFocusMode(zone, Number(zoomMargin?.value));
this.cameraManager.enterFocusMode(
zone,
zoomMargin ? Math.max(0, Number(zoomMargin.value)) : undefined
);
break;
}
}