# Camera

The camera object allows you to render a transformed section of the scene.
The camera is orthogonal so it cannot be tilted to produce 3D effects.
A camera must be assigned to some viewport object in order to render its contents on the screen.
Nothing will be rendered at all, unless the camera is also inserted in a layer that contains some other visible sprites.

The position of a camera is relative to the origin of its parent layer.
Scaling and rotating the camera affects the size and orientation its viewing area.

Figure 1: The camera's viewing area

## Properties

- .color

Color modulation value. This is a Color object

- .rotation

Rotation of the camera in degrees. This is a number value (default is 0)

- .scalex

Horizontal zoom of the camera. This is a number value (default is 1)

- .scaley

Vertical zoom of the camera. This is a number value (default is 1)

- .x

X-position of the camera in parent coordinates. This is a number value (default is 0)

- .y

Y-position of the camera in parent coordinates. This is a number value (default is 0)

## Constructors

- Camera ( [x, y] )

Creates a new camera object

## Functions

- change_position ( x, y )

Translates the camera by a given amount

- change_rotation ( degrees )

Rotates the camera around its origin by a given amount in degrees

- change_rotation_r ( radians )

Rotates the camera around its origin by a given amount in radians

- change_scale ( x, y )

Scales the camera zoom by a given amount

- change_scalex ( x )

Scales the camera zoom horizontally by a given amount

- change_scaley ( y )

Scales the camera zoom vertically by a given amount

- get_local_point ( x, y )

Transforms a position from topmost parent to local coordinates.
Returns the transformed coordinates

- get_parent_point ( x, y )

Transforms a position from local to parent coordinates. Returns the transformed coordinates

- get_world_point ( x, y )

Transforms a position from local to topmost parent coordinates
Returns the transformed coordinates

- set_position ( x, y )

Translates the camera to a given location

- set_rotation ( degrees )

Rotates the camera to a given angle in degrees

- set_rotation_r ( radians )

Rotates the camera to a given angle in radians

- set_scale ( x, y )

Scales the camera zoom to given proportions