carenalgas / popochiu

Godot plugin to make point n' click games in a similar way to tools like Adventure Game Studio and Power Quest.
MIT License
177 stars 18 forks source link

Update way to define camera limits for Room #244

Closed mapedorr closed 3 weeks ago

mapedorr commented 2 months ago

Benefit description

The way camera boundaries are defined in a room can be confusing as it requires developers to calculate the background offset relative to the game's viewport size. Instead, it should be enough to define the room size (which in most cases should match the background dimensions) so that Popochiu can take care of the calculations and set up the camera.

Solution description

Instead of having the current:

@export var limit_left := INF
@export var limit_right := INF
@export var limit_top := INF
@export var limit_bottom := INF

Use:

@export var width := E.width
@export var height := E.height

Exclusions

None.

Implications

Changing this will require adding a step to Migration 2 (or Migration 3 if we decide to move this change to Popochiu 2.1) so rooms from previous versions are updated to use this approach.

mapedorr commented 3 weeks ago

Closed by #257