Camera following object with offset?

Is it possible to use the camera like this: The cam should follow an object (player) but the player should not be centered in the screen but more to the left side of the screen.

Is it possible to do this with the camera system somehow?

If you open Dusk/dusk_core/run/camera.lua and edit around line 44:

viewY = screen.centerY, masterOffsetX = 0, --EDIT THIS! masterOffsetY = 0,

I added a variable “cameraOffset” to dusk/dusk_core/misc/settings.lua

so I can(before I build the map):

local cameraOffset = (centerX \* 0.25) \* -1 dusk.setPreference("cameraOffset", cameraOffset) then in camera.lua masterOffsetX = getSetting("cameraOffset"),

There might be a better way then to edit the camera.lua file, but this works :slight_smile:

Thank you bendikr5 for the help!!!

If you open Dusk/dusk_core/run/camera.lua and edit around line 44:

viewY = screen.centerY, masterOffsetX = 0, --EDIT THIS! masterOffsetY = 0,

I added a variable “cameraOffset” to dusk/dusk_core/misc/settings.lua

so I can(before I build the map):

local cameraOffset = (centerX \* 0.25) \* -1 dusk.setPreference("cameraOffset", cameraOffset) then in camera.lua masterOffsetX = getSetting("cameraOffset"),

There might be a better way then to edit the camera.lua file, but this works :slight_smile:

Thank you bendikr5 for the help!!!