Advanced Camera

Dream it, build it!

Advanced Camera

Advanced camera plugin for Construct 3

This plugin is currently in development, and will soon be published for purchasing it on multiple asset stores like itchio and construct asset store, follow our social networks for more information.

Advanced Camera is a 2D plugin that creates a complex pre-programmed camera for you.

This plugin simplifies and enhances the process of creating a complex camera in your games. What is usually a task of inserting several behaviors and adding events is turned into a simple plug-n-play activity by inserting the plugin in the layout, you will have a fully functional and customizable camera with no additional programming required in just seconds.

The plugin is a world-plugin, which means you can add it to the layout and locate it using the UI making it cleaner to manage. You can also rotate and resize it using the UI. Havin a world plugin allows you to add multiple cameras in the same layout to switch between them as needed. Due the the nature of the plugin, you can only have one camera active at the same time, and alternate between them as neede in your design.

The plugin offers four camera modes, camera motions with easing, it is fully compatible with timelines, save/load, scenegraph hierarchy, and supports advanced minification exports as well as worker mode. The camera is also integrated with the common ACE's like the position, size and angle. When using the transformation ACEs to affect the size, position and angle, the camera will also update the rendering. For instance, if you set the camera angle to 45, all of the layers registered to be rotated will be automatically set to 45 degrees to with no additional effort.

The camera types offered by the plugin are:

  1. Stand Still Camera. A simple camera that is fixed in the layout.
  2. Scroll-To Camera. A camera that follows an object or a set of objects at the same time.
  3. BoxTrap Camera. A more stable camera that creates a bounding box that follows the player only when he/she leaves the box.
  4. Grid Camera. A zelda-like camera that creates a grid in your layout and automatically changes the area when the player leaves the occupied grid-cell.

All the camera styles available can work tracking multiple instances at the same time, when this happens, the camera tracks the average position of all of the objects that exist in the layout. You can also set if the tracking should be static, tracking the same number of instances as when the Set Tracking was called; dynamic tracking updates the list of objects to track in realtime, if an instance is destroyed or added to the layout, the tracker will update automatically.

The plugin also offers different motions executed with easing functions to Move-To a location, Rotate-To an angle and even Zoom to a target scale. The easing functions supported immediately gives a highly-polished look-and-feel to your game and all of the motion types are framerate independent.

General Properties

Properties Description
Camera Type Specifies the camera type to use.
Debug View Displays the bounding box of the camera during gameplay
Enabled Sets the plugin enabled or disabled

Grid Camera Properties

Properties Description
Show Grid Displays the grid. Only relevant for Grid Camera
Grid Width Grid width. Only relevant for Grid Camera
Grid Height Grid height. Only relevant for Grid Camera

Camera Limits Properties

Properties Description
Clamp Camera Prevents the camera from going out of the specified bounding-box
Left Limit Left limit in the X axis (left)
Top Limit Top limit in the Y axis (Top)
Bounding Box width Camera displacement bounding-box width, starting from Left limit
Bounding Box height Camera displacement bounding-box heigt, starting from Top limit

Actions


Set Debug

Set camera's debug quad enabled/disabled during gameplay

Set Camera Bounds

Sets the camera bounds and clamps its movement to the specified bounding-box.

Parameter Description
Left Left Coordinate (X)
Top Top Coordinate (Y)
Width Camera width
Height Camera height

Move To

Moves the camera to the specified position applying an easing function. This an asynchronous action that allows you to add a Wait-for-previous-action-to-complete after it to sync your game animations. You can also use the trigger conditions for the same purpose.

Parameter Description
X X Coordinate
Y Y Coordinate
Type Easing function to apply to the movement
Time Time in seconds to complete the movement
Tag Tag to identify the motion

Shake

Shakes the screen with a custom intensity function for a period of time. This an asynchronous action that allows you to add a Wait-for-previous-action-to-complete after it to sync your game animations. You can also use the trigger conditions for the same purpose.

Parameter Description
Magnitude Magnitude in pixels to shake the camera off
Duration Duration in seconds
Type Itensity function to use
Tag Tag to identify the shake
Frequency Shake cycles per second (Valid values:1 to 30). Only relevant when setting a Wave function.
Wave Wave function to affect the screen shake offsetting

Set Tracking

Sets the tracking type for this camera.

  1. Stand Still Camera. A simple camera that is fixed in the layout.
  2. Scroll-To Camera. A camera that follows an object or a set of objects at the same time.
  3. BoxTrap Camera. A more stable camera that creates a bounding box that follows the player only when he/she leaves the box.
  4. Grid Camera. A zelda-like camera that creates a grid in your layout and automatically changes the area when the player leaves the occupied grid-cell.
Parameter Description
Camera Type Specifies the camera type to use.

Ease transition

Sets the camera ease function to use when tracking an object

Parameter Description
Type Easing function to track the object
Step value Step value for the linear interpolation of the camera

Track Object

Sets the objects to be tracked by the camera

Parameter Description
Object Object to track
Type Tracking type. Dynamic tracking updates the objects in the layout every tick; Static tracking always tracks the picked instances at the moment of calling Track Object action.

Set Enabled

Activates/Deactivates the Advanced Camera plugin

Parameter Description
Enabled Indicator to Enabled/Disabled the plugin

Switch Camera

Switches on the camera and disables all the AdvancedCamera instances found in the layout

Set Default Scale

Establishes the default scale for the registered layers and immediately adjusts all the layers.

Parameter Description
Scale Default scale (min value is 0.1)

Set Default Angle

Establishes the default angle for the registered layers and immediately adjusts all the layers.

Parameter Description
Angle Default angle

Restore Camera

Restores the main transform properties of the camera setting its angle and scale back to the defaults values. If not changed, the default scale is 1 and the default angle is 0.

Restore Default Angle

Restores the angle of all the registered layers to the default angle and immediately adjusts all the layers.

Restore Default Scale

Restores the scale of all the registered layers to the default scale and immediately adjusts all the layers.

Stop Tracking

Stops tracking objects

Stop Zoom

Stops the running Zoom and marks it has completed, then it triggers the OnZoomFinished and OnAnyZoomFinished conditions

Stop Movement

Stops the running Move-To action and marks it has completed, then it triggers the OnMovementFinished and OnAnyMovementFinished conditions

Stop Rotation

Stops the running Rotate-To action and marks it has completed, then it triggers the OnRotationFinished and OnAnyRotationFinished conditions

Zoom

Zooms the registered layers to a target scale using an easing function. This an asynchronous action that allows you to add a Wait-for-previous-action-to-complete after it to sync your game animations. You can also use the trigger conditions for the same purpose.

Parameter Description
Scale Target scale to zoom to (minimum possible scale is 0.1)
Time Time in seconds to complete the zoom. Set it to zero for an instant Zoom.
Type Easing function to apply
Tag Tag to identify the zoom

Add Zoom Layer

Registers a layer to be handled by the Zoom action.

Parameter Description
Layer Layer name

Add Rotation Layer

Registers a layer to be handled by the rotation of the camera.

Parameter Description
Layer Layer name

Rotate To

Rotates all the registered layers to the indicated angle. This action has no effect if no layers are registered with 'Add Rotation Layer' action. This an asynchronous action that allows you to add a Wait-for-previous-action-to-complete after it to sync your game animations. You can also use the trigger conditions for the same purpose.

Parameter Description
Angle Target angle to rotate to
Type Easing function to apply
Direction Direction of the rotation: clockwise or counter-clockwise.
Time Time in seconds to complete the rotation
Tag Tag to identify the rotation

Pause Zoom

Pauses the current Zoom and marks it has uncompleted.

Pause Movement

Pauses the current Move-To running and marks it has uncompleted.

Pause Rotation

Pauses the current Rotate-To and marks it has uncompleted.

Resume Zoom

Resumes the last paused Zoom.

Resume Movement

Resumes the last paused Move-To.

Resume Rotation

Resumes the last paused Rotate-To.

Conditions


Is Enabled

Returns true if the camera is enabled

Is Moving

Returns true if the camera is moving by a Move To action

Is Tag Moving

Returns true if the camera is moving for the specified Tag by a Move To action

Parameter Description
Tag Tag to identify the motion

On Movement Finished

Triggered when a Move-To action has completed

Parameter Description
Tag Tag to identify the motion

On Any Movement Finished

Triggered when any Move-To action has completed

Is Rotating

Returns true if the camera is rotating by a Rotate To action

Is Tag Rotating

Returns true if the camera is rotating for the specified Tag by a Rotate To action

Parameter Description
Tag Tag to identify the rotation

On Rotation Finished

Triggered when a Rotate-To action has completed

Parameter Description
Tag Tag to identify the rotation

On Any Rotation Finished

Triggered when any Rotate-To action has completed

Is Zooming

Returns true if the camera is zooming by a Zoom action

Is Tag Zooming

Returns true if the camera is zooming for the specified Tag by a Zoom action

Parameter Description
Tag Tag to identify the zoom

On Zoom Finished

Triggered when a zoom action has completed

Parameter Description
Tag Tag to identify the zoom

On Any Zoom Finished

Triggered when any zoom action has completed

Is Shaking

Returns true if the camera is shaking

Is Tag Shaking

Returns true if the camera is shaking for the specified Tag by a Shake action

Parameter Description
Tag Tag to identify the shake

On Shake Completed

Triggered when the specified shake action has completed

Parameter Description
Tag Tag to identify the shake

On Any Shake Finished

Triggered when any shake action has completed

Expressions


GetZoomTag

Returns the tag forthe last Zoom called

GetShakeTag

Returns the tag for the last Shake called

GetMoveTag

Returns the tag for the last Move-To called

GetRotationTag

Returns the tag for the last Rotate-To called

GetMovementProgress

Returns current progress of the Move-To action (From 0 to 1)

GetZoomProgress

Returns current progress of the Zoom action (From 0 to 1)

GetRotationProgress

Returns current progress of the Rotate-To action (From 0 to 1)