CameraController:cut_to

Cuts to another camera, playing transitions in-between. Calling this function cancels any in-progress move_to or cut_to operation.

Usage

camera_controller:cut_to(new_camera, ...)

Arguments

Name Type Description
new_camera Camera Camera to cut to.
... Transition Transitions to play.

Returns

Name Type Description
thread Thread A thread that completes when all transitions are finished.

Examples

local old_camera = crystal.Camera:new();
old_camera.position = function() return 0, 300; end;

local new_camera = crystal.Camera:new();
new_camera.position = function() return 100, 200; end;

local camera_controller = crystal.CameraController:new();
self.camera_controller:cut_to(old_camera);
self.camera_controller:cut_to(
  new_camera,
  crystal.Transition.FadeToBlack:new(),
  crystal.Transition.FadeFromBlack:new()
);

This site uses Just the Docs, a documentation theme for Jekyll.