summaryrefslogtreecommitdiff
path: root/doc/classes/ParallaxBackground.xml
blob: 3186f6b9725cfb42990c98df9056eabe1e7ccbd6 (plain)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ParallaxBackground" inherits="CanvasLayer" category="Core" version="3.0-alpha">
	<brief_description>
		A node used to create a parallax scrolling background.
	</brief_description>
	<description>
		A ParallaxBackground uses one or more [ParallaxLayer] child nodes to create a parallax effect. Each [ParallaxLayer] can move at a different speed using [member ParallaxLayer.motion_offset]. This creates an illusion of depth in a 2D game. If not used with a [Camera2D], you must manually calculate the [member scroll_offset].
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
		<method name="get_limit_begin" qualifiers="const">
			<return type="Vector2">
			</return>
			<description>
				Return the beginning limit.
			</description>
		</method>
		<method name="get_limit_end" qualifiers="const">
			<return type="Vector2">
			</return>
			<description>
				Return the ending limit.
			</description>
		</method>
		<method name="get_scroll_base_offset" qualifiers="const">
			<return type="Vector2">
			</return>
			<description>
				Return the base offset.
			</description>
		</method>
		<method name="get_scroll_base_scale" qualifiers="const">
			<return type="Vector2">
			</return>
			<description>
				Return the base motion scale.
			</description>
		</method>
		<method name="get_scroll_offset" qualifiers="const">
			<return type="Vector2">
			</return>
			<description>
			</description>
		</method>
		<method name="is_ignore_camera_zoom">
			<return type="bool">
			</return>
			<description>
				Return ignoring camera zoom.
			</description>
		</method>
		<method name="set_ignore_camera_zoom">
			<return type="void">
			</return>
			<argument index="0" name="ignore" type="bool">
			</argument>
			<description>
				Set to true for all child [ParallaxLayer] nodes to not be affected by the zoom level of the camera.
			</description>
		</method>
		<method name="set_limit_begin">
			<return type="void">
			</return>
			<argument index="0" name="ofs" type="Vector2">
			</argument>
			<description>
				Set the left and top limits in pixels for scrolling to begin. If the camera is outside of this limit the background will not continue to scroll. If an axis is greater than or equal to the corresponding axis of limit_end, then it will not limit scrolling for that axis.
			</description>
		</method>
		<method name="set_limit_end">
			<return type="void">
			</return>
			<argument index="0" name="ofs" type="Vector2">
			</argument>
			<description>
				Set the right and bottom limits in pixels for scrolling to end. If the camera is outside of this limit the background will not continue to scroll. If an axis is less than or equal to the corresponding axis of limit_begin, then it will not limit scrolling for that axis.
			</description>
		</method>
		<method name="set_scroll_base_offset">
			<return type="void">
			</return>
			<argument index="0" name="ofs" type="Vector2">
			</argument>
			<description>
				Set the base offset in pixels of all children [ParallaxLayer] nodes.
			</description>
		</method>
		<method name="set_scroll_base_scale">
			<return type="void">
			</return>
			<argument index="0" name="scale" type="Vector2">
			</argument>
			<description>
				Set the base motion scale of all children [ParallaxLayer] nodes.
			</description>
		</method>
		<method name="set_scroll_offset">
			<return type="void">
			</return>
			<argument index="0" name="ofs" type="Vector2">
			</argument>
			<description>
			</description>
		</method>
	</methods>
	<members>
		<member name="scroll_base_offset" type="Vector2" setter="set_scroll_base_offset" getter="get_scroll_base_offset">
			Base position offset of all [ParallaxLayer] children.
		</member>
		<member name="scroll_base_scale" type="Vector2" setter="set_scroll_base_scale" getter="get_scroll_base_scale">
			Base motion scale of all [ParallaxLayer] children.
		</member>
		<member name="scroll_ignore_camera_zoom" type="bool" setter="set_ignore_camera_zoom" getter="is_ignore_camera_zoom">
			If [code]true[/code] elements in [ParallaxLayer] child aren't affected by the zoom level of the camera.
		</member>
		<member name="scroll_limit_begin" type="Vector2" setter="set_limit_begin" getter="get_limit_begin">
			Top left limits for scrolling to begin. If the camera is outside of this limit the background will stop scrolling. Must be lower than [member scroll_limit_end] to work.
		</member>
		<member name="scroll_limit_end" type="Vector2" setter="set_limit_end" getter="get_limit_end">
			Right bottom limits for scrolling to end. If the camera is outside of this limit the background will stop scrolling. Must be higher than [member scroll_limit_begin] to work.
		</member>
		<member name="scroll_offset" type="Vector2" setter="set_scroll_offset" getter="get_scroll_offset">
			The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but can be used to manually manage scrolling when no camera is present.
		</member>
	</members>
	<constants>
	</constants>
</class>