rellax version 0.2.2Get Latest Release rellax.scm |
GitHub Repo |
Demo Windows |
Demo Linux |
Download project .zip Rellax while the camera tracks with cool parallax
This module uses the camera and Viewport API from Adventure Game Studio 3.5.0.Demo game uses keyboard arrows control, up arrow jumps. WASD should also work.
UsageBefore starting, you must create the following Custom Properties in AGS Editor, for usage with Objects.
Just click on
Properties [...] and on the
Edit Custom Properties screen, click on
Edit Schema ... button, and add the two properties below:
PxPos:
- Name: PxPos
- Description: Object's horizontal parallax
- Type: Number
- Default Value: 0
PyPos:
- Name: PyPos
- Description: Object's vertical parallax
- Type: Number
- Default Value: 0
The number defined on Px or Py will be divided by 100 and used to increase the scrolling.
An object with
Px and
Py 0 is scrolled normally, an object with
Px and
Py 100 will be fixed on the screen despite camera movement.
Objects with negative
Px and
Py are usually at the front, and positive values are usually at the back.
Script APIstatic attribute Character* TargetCharacterThe character being tracked by the Game.Camera.
static attribute bool EnableParallaxGets/sets whether Parallax is on or off.
static attribute bool EnableSmoothCamGets/sets whether Smooth Camera tracking is on or off.
static attribute bool AdjustCameraOnRoomLoadGets/sets whether to instantly adjust camera to target on room before fade in, when Smooth Camera is on.
static attribute int CameraOffsetXGets/sets the camera horizontal offset.
static attribute int CameraOffsetYGets/sets the camera vertical offset.
static attribute int CameraLookAheadXGets/sets the camera horizontal lookahead offset. This is an additional offset that is added in the direction the target character is facing (only 4 direction support now).
static attribute int CameraLookAheadYGets/sets the camera vertical lookahead offset. This is an additional offset that is added in the direction the target character is facing (only 4 direction support now).
static attribute int StandstillCameraDelayYGets/sets number of frames to wait before adjusting the Y axis quicker after the player is still. Set to 0 to disable it. This is more useful on platformers, or vertical rooms that have different pavements.
static attribute int CameraLerpFactorXGets/sets the factor the camera should use when interpolating in the X axis.
static attribute int CameraLerpFactorYGets/sets the factor the camera should use when interpolating in the Y axis.
static attribute int CameraWindowWidthGets/sets the camera window width that is centered on the target lookahead point, when the target is outside of the window, the camera moves to keep it inside.
static attribute int CameraWindowHeightGets/sets the camera window height that is centered on the target lookahead point, when the target is outside of the window, the camera moves to keep it inside.
LicenseThis module is created by eri0o is provided with MIT License, see
LICENSE for more details.
The code on this module is based on the code of Smooth Scrolling + Parallax Module from Alasdair Beckett, which bases on code from Steve McCrea.
The demo game uses CC0 (Public Domain) art provided by
jetrel.