Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_cameraFollower

Plugin, ACE table, Discussion thread
Dependence: None

Introduction
Move object to follow camera with a ratio. It could be used to simulate parallax.

Usage
Concept
There are two kinds of object, follower or camera, follower will move to camera with a moving ratio.
For example, if the follower's moving ratio X is 0.5, and the camera moved forward 100 pixels in axis X. Then the follower will move forward
100 * 0.5 = 50
pixels in axis X.

Follower
Add this behavior in follower object, and set the property "Type" to "
Follower".
Moving ratio
Moving ratio of XY is set in properties "X", "Y", or set by "
Action:Set moving ratio X", "Action:Set moving ratio Y".
  • Sets the moving ratio to 1 will keep the relative distance from follower to camera. It looks like setting parallax to 0.
  • Sets the moving ratio to 0 will stay without moving. It looks like setting parallax to 100.
  • Sets the moving ratio to 0.3 will follow the camera slowly. It looks like setting parallax to 70.
Enable
Following could be enabled or disabled by "Action:Set following", or set in property "Activated".

Camera
Camera could be controlled by official scroll-to behavior, or by "system action:scroll to"
Scroll-to behavior
Sample capx
Add this behavior under scroll-to behavior in behavior list of all camera objects.
图片
And set the property "Type" to "Camera".
System action: scroll to
Sample capx
There is no camera object, camera moving is set by "system action: scroll to".

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About