ex_camera_create

Creates a new camera object and assigns a view to it

Syntax

ex_camera_create(viewIndex, trackingObject)
Argument Description
viewIndex The view index
trackingObject The tracking object, the object that the camera's view will follow
Returns the ID of the created camera object, referred to as cameraHandle

Description

Before you can manipulate your view with exCamera, you first need to create a new camera object. It is strongly recommended to use a global variable to store your camera handle. ex_camera_create() should be used before using any other ex_camera functions that explicitly manipulate the view. The trackingObject parameter should contain a valid instance id but it is optional (you can pass the keyword noone) and can be specified later on using ex_camera_set_tracking_object(). To manipulate the camera manually, when no tracking object is being specified, you can use the function ex_camera_set_position(). The camera width & height is predetermined by the view Room settings and can be changed either through that or with ex_camera_set_size() function.

Example

//Create a camera object, store the resulting cameraHandle in global variable "global._camera" and don't assign the tracking object
global._camera = ex_camera_create(0, noone);

//Create a camera object, store the resulting cameraHandle in global variable "global._camera" and assign the tracking object to obj_camera_manipulator
global._camera = ex_camera_create(0, obj_camera_manipulator);

Minimum Supported Version

exCamera 0.5.0