-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.BBCode
96 lines (69 loc) · 5.92 KB
/
README.BBCode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[size=14pt][b]rellax[/b][/size] [color=gray][b]version 0.4.0[/b][/color]
[url="https://github.com/ericoporto/rellax/releases/download/0.4.0/rellax.scm"]Get Latest Release [b]rellax.scm[/b][/url] | [url="https://github.com/ericoporto/rellax"]GitHub Repo[/url] | [url="https://github.com/ericoporto/rellax/releases/download/0.4.0/rellax_demo_windows.zip"]Demo Windows[/url] | [url="https://github.com/ericoporto/rellax/releases/download/0.4.0/rellax_demo_linux.tar.gz"]Demo Linux[/url] | [url="https://github.com/ericoporto/rellax/archive/master.zip"]Download project .zip [/url]
Rellax while the camera tracks with cool parallax
[url="https://imgur.com/nJGnylM"][img width=640 height=360]https://raw.githubusercontent.com/ericoporto/rellax/master/rellax_demo.gif[/img][/url]
[i]This module uses the camera and Viewport API from [b]Adventure Game Studio 3.5.0[/b].[/i]
Demo game uses keyboard arrows control, up arrow jumps. WASD should also work.
[hr]
[i][b]Usage[/b][/i]
Before starting, you must create the following Custom Properties in AGS Editor, for usage with Objects.
Just click on [b][font=Courier New]Properties [...][/font][/b] and on the [b][font=Courier New]Edit Custom Properties[/font][/b] screen, click on [b][font=Courier New]Edit Schema ...[/font][/b] button, and add the two properties below:
[size=14pt]PxPos[/size]:
[list]
[li][b][font=Courier New]Name[/font]:[/b] [font=Courier New]PxPos[/font][/li]
[li][b][font=Courier New]Description[/font]:[/b] [font=Courier New]Object's horizontal parallax[/font][/li]
[li][b][font=Courier New]Type[/font]:[/b] [font=Courier New]Number[/font][/li]
[li][b][font=Courier New]Default Value[/font]:[/b] [font=Courier New]0[/font][/li]
[/list]
[size=14pt]PyPos[/size]:
[list]
[li][b][font=Courier New]Name[/font]:[/b] [font=Courier New]PyPos[/font][/li]
[li][b][font=Courier New]Description[/font]:[/b] [font=Courier New]Object's vertical parallax[/font][/li]
[li][b][font=Courier New]Type[/font]:[/b] [font=Courier New]Number[/font][/li]
[li][b][font=Courier New]Default Value[/font]:[/b] [font=Courier New]0[/font][/li]
[/list]
[u]The number defined on [font=Courier New]Px[/font] or [font=Courier New]Py[/font] will be divided by 100 and used to increase the scrolling[/u].
An object with [font=Courier New]Px[/font] and [font=Courier New]Py[/font] 0 is scrolled normally, an object with [font=Courier New]Px[/font] and [font=Courier New]Py[/font] 100 will be fixed on the screen despite camera movement.
Objects with negative [font=Courier New]Px[/font] and [font=Courier New]Py[/font] are usually at the front, and positive values are usually at the back.
[hr]
[i][b]Script API[/b][/i]
[b][font=Courier New]static attribute Character* TargetCharacter[/font][/b]
The character being tracked by the Game.Camera.
[b][font=Courier New]static attribute bool EnableParallax[/font][/b]
Gets/sets whether Parallax is on or off.
[b][font=Courier New]static attribute bool EnableSmoothCam[/font][/b]
Gets/sets whether Smooth Camera tracking is on or off.
[b][font=Courier New]static attribute bool AutomaticallySetupOnRoomLoad[/font][/b]
Gets/sets whether to automatically setup on room load. It defaults to yes (true).
Leave as this unless you really need it.
[b][font=Courier New]static void SetupRoomManually()[/font][/b]
You should not call this, unless AutomaticallySetupOnRoomLoad is false.
Then call this at the end of your room_Load, after you are done setting things up.
[b][font=Courier New]static attribute bool AdjustCameraOnRoomLoad[/font][/b]
Gets/sets whether to instantly adjust camera to target on room before fade in, when Smooth Camera is on. Default is true.
[b][font=Courier New]static attribute RellaxTweenEasingType EasingType[/font][/b]
gets/sets the camera tween type to use when the character is stopped.
[b][font=Courier New]static attribute float TweenDuration[/font][/b]
gets/sets the camera tween duration once the character is stopped.
[b][font=Courier New]static attribute int CameraOffsetX[/font][/b]
Gets/sets the camera horizontal offset. It's applied without smoothing.
[b][font=Courier New]static attribute int CameraOffsetY[/font][/b]
Gets/sets the camera vertical offset. It's applied without smoothing.
[b][font=Courier New]static attribute int CameraLookAheadX[/font][/b]
Gets/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).
[b][font=Courier New]static attribute int CameraLookAheadY[/font][/b]
Gets/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).
[b][font=Courier New]static attribute int CameraLerpFactorX[/font][/b]
Gets/sets the factor the camera should use when interpolating in the X axis.
[b][font=Courier New]static attribute int CameraLerpFactorY[/font][/b]
Gets/sets the factor the camera should use when interpolating in the Y axis.
[b][font=Courier New]static attribute int CameraWindowWidth[/font][/b]
Gets/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.
[b][font=Courier New]static attribute int CameraWindowHeight[/font][/b]
Gets/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.
[hr]
[i][b]License[/b][/i]
This module is created by eri0o is provided with MIT License, see [url="https://github.com/ericoporto/rellax/blob/master/LICENSE"]LICENSE[/url] 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.
It uses easing code based on Edmundo Ruiz and Robert Penner's, works, which are MIT and BSD licensed, respectively (and included in the module script).
The demo game uses CC0 (Public Domain) art provided by [url="https://opengameart.org/users/jetrel"]jetrel[/url].