CameraController:move_to

Interpolates to another camera. Calling this function cancels any in-progress move_to or cut_to operation.

Usage

camera_controller:move_to(new_camera, duration, easing)

Arguments

Name Type Description
new_camera Camera Camera to cut to.
duration number Duration of the move, in seconds.
easing function Easing function to smooth movement with.

Returns

Name Type Description
thread Thread A thread that completes when movement is 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:move_to(new_camera, 0.5, math.ease_in_out_cubic);

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