맵별 고정 카메라 (MapCamera) — 11맵 카메라 framing 고정 #20

Merged
gahusb merged 3 commits from feature/map-camera into main 2026-06-09 23:28:58 +09:00
3 changed files with 6 additions and 3 deletions
Showing only changes of commit fbf5cfe19f - Show all commits

View File

@@ -47,7 +47,7 @@
"Name": null "Name": null
}, },
"Arguments": [], "Arguments": [],
"Code": "self.CamTries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.CamTries = self.CamTries + 1\n\tlocal cam = nil\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tcam = lp.CameraComponent\n\tend\n\tif cam == nil then\n\t\tcam = _CameraService:GetCurrentCameraComponent()\n\tend\n\tif cam ~= nil then\n\t\tcam.ZoomRatio = 100\n\t\tcam.ScreenOffset = Vector2(0.5, 0.655)\n\t\tcam.ConfineCameraArea = true\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.CamTries > 30 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)", "Code": "self.CamTries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.CamTries = self.CamTries + 1\n\tlocal cam = nil\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tcam = lp.CameraComponent\n\tend\n\tif cam == nil then\n\t\tcam = _CameraService:GetCurrentCameraComponent()\n\tend\n\tif cam ~= nil then\n\t\tcam.ZoomRatio = 90\n\t\tcam.ScreenOffset = Vector2(0.5, 0.655)\n\t\tcam.ConfineCameraArea = true\n\t\tcam.CameraOffset = Vector2(1.5, -1)\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.CamTries > 30 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)",
"Scope": 2, "Scope": 2,
"ExecSpace": 6, "ExecSpace": 6,
"Attributes": [], "Attributes": [],

View File

@@ -1,6 +1,8 @@
{ {
"zoomRatio": 100, "zoomRatio": 90,
"screenOffsetX": 0.5, "screenOffsetX": 0.5,
"screenOffsetY": 0.655, "screenOffsetY": 0.655,
"confineCameraArea": true "confineCameraArea": true,
"cameraOffsetX": 1.5,
"cameraOffsetY": -1
} }

View File

@@ -63,6 +63,7 @@ local function apply()
cam.ZoomRatio = ${CAM.zoomRatio} cam.ZoomRatio = ${CAM.zoomRatio}
cam.ScreenOffset = Vector2(${CAM.screenOffsetX}, ${CAM.screenOffsetY}) cam.ScreenOffset = Vector2(${CAM.screenOffsetX}, ${CAM.screenOffsetY})
cam.ConfineCameraArea = ${CAM.confineCameraArea} cam.ConfineCameraArea = ${CAM.confineCameraArea}
cam.CameraOffset = Vector2(${CAM.cameraOffsetX}, ${CAM.cameraOffsetY})
_TimerService:ClearTimer(eventId) _TimerService:ClearTimer(eventId)
elseif self.CamTries > 30 then elseif self.CamTries > 30 then
_TimerService:ClearTimer(eventId) _TimerService:ClearTimer(eventId)