Skip to content

YaCameraAPI

The YaCameraAPI static class provides functionality to adjust the player's camera in a game scene.
  • Setting_CameraFixPositionAndOrientation
  • Setting_CameraFixPositionAndViewControllable
  • Setting_CameraFixPositionAndLookAt
  • Setting_CameraTopdown. With this component, the SetCameraPosition and SetCameraOrientation functions are unavailable.
  • Setting_CameraRTS
  • Setting_CameraSideScroll. With this component, the SetCameraPosition and SetCameraOrientation functions are unavailable.
  • Setting_CameraThirdPerson. With this component, the SetCameraPosition function is unavailable.

Functions

YaPostProcessBloomHandle YaCameraAPI.InstanceBloomHandle(YaEntity targetPlayer)

ReturnsThe post-process bloom handle
Applies post-process bloom effect to the target of the camera.
  • targetPlayer The player entity or avatar entity that player is controlling
1
2
3
4
5
local handle = YaCameraAPI.InstanceBloomHandle(script:SelfEntity())
handle.Color = float3.New(0.26, 0.1, 0.24)
handle.Intensity = 0.4
handle:Play()
-- if want to stop post process, call handle:Stop()

YaPostProcessBloomHandle YaCameraAPI.InstanceBloomHandleGlobal()

ReturnsThe post-process bloom handle
Applies post-process bloom effect to all entities in the scene that the camera renders.
1
2
3
4
5
local handle = YaCameraAPI.InstanceBloomHandleGlobal()
handle.Color = float3.New(0.26, 0.1, 0.24)
handle.Intensity = 0.4
handle:Play()
-- if want to stop post process, call handle:Stop()

YaPostProcessColorAdjustHandle YaCameraAPI.InstanceColorAdjustHandle(YaEntity targetPlayer)

ReturnsThe post-process color adjustment handle
Applies post-process color adjustment to the target of the camera
  • targetPlayer The player entity or avatar entity that player is controlling
1
2
3
4
5
6
local handle = YaCameraAPI.InstanceColorAdjustHandle(script:SelfEntity())
handle.PostExposure = 1
handle.Contrast = 100
handle.ColorFilter = float3.New(0.5, 0.35, 0.35)
handle:Play()
-- If you want to stop post process, call handle:Stop()

YaPostProcessColorAdjustHandle YaCameraAPI.InstanceColorAdjustHandleGlobal()

ReturnsThe post-process color adjustment handle
Applies post-process color adjustment to all entities in the scene that the camera renders.
1
2
3
4
5
6
local handle = YaCameraAPI.InstanceColorAdjustHandleGlobal()
handle.PostExposure = 1
handle.Contrast = 100
handle.ColorFilter = float3.New(0.5, 0.35, 0.35)
handle:Play()
-- If you want to stop post process, call handle:Stop()

YaPostProcessVignetteHandle YaCameraAPI.InstanceVignetteHandle(YaEntity targetPlayer)

ReturnsThe post-process color adjustment handle
Applies post-process vignette effect to the target of the camera
  • targetPlayer The player entity or avatar entity that player is controlling
1
2
3
4
local handle = YaCameraAPI.InstanceVignetteHandle(script:SelfEntity())
handle.Intensity = 0.572
handle:Play()
-- If you want to stop post process, call handle:Stop()

YaPostProcessVignetteHandle YaCameraAPI.InstanceVignetteHandleGlobal()

ReturnsThe post-process vignette handle
Applies post-process vignette to all entities in the scene that teh camera renders
1
2
3
4
local handle = YaCameraAPI.InstanceVignetteHandleGlobal()
handle.Intensity = 0.572
handle:Play()
-- If you want to stop post process, call handle:Stop()

YaPostProcessBlurHandle YaCameraAPI.InstanceBlurHandle(YaEntity targetPlayer)

ReturnsThe post-process blur adjustment handle
Applies post-process blur adjustment to the target of the camera
  • targetPlayer The player entity or avatar entity that player is controlling
1
2
3
4
5
local handle = YaCameraAPI.YaPostProcessBlurHandle(script:SelfEntity())
handle.Intensity = 1
handle.Iterations = 5
handle:Play()
-- If you want to stop post process, call handle:Stop()

YaPostProcessBlurHandle YaCameraAPI.InstanceBlurHandleGlobal()

ReturnsThe post-process blur adjustment handle
Applies post-process blur adjustment to all entities in the scene that the camera renders.
1
2
3
4
5
local handle = YaCameraAPI.InstanceBlurHandleGlobal()
handle.Intensity = 1
handle.Iterations = 5
handle:Play()
-- If you want to stop post process, call handle:Stop()

YaPostProcessMaskHandle YaCameraAPI.InstanceMaskHandle(YaEntity targetPlayer)

ReturnsThe post-process mask adjustment handle
Applies post-process mask adjustment to the target of the camera
  • targetPlayer The player entity or avatar entity that player is controlling
1
2
3
4
5
6
local handle = YaCameraAPI.InstanceMaskHandle(script:SelfEntity())
handle.Intensity = 1
handle.Color = float4.New(1,0,0,1)
handle.Smoothness = 1
handle:Play()
-- If you want to stop post process, call handle:Stop()

YaPostProcessMaskHandle YaCameraAPI.InstanceMaskHandleGlobal()

ReturnsThe post-process color adjustment handle
Applies post-process color adjustment to all entities in the scene that the camera renders.
1
2
3
4
5
6
local handle = YaCameraAPI.InstanceMaskHandleGlobal()
handle.Intensity = 1
handle.Color = float4.New(1,0,0,1)
handle.Smoothness = 1
handle:Play()
-- If you want to stop post process, call handle:Stop()