File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ typedef StageDataProp =
171
171
* How much the prop scrolls relative to the camera. Used to create a parallax effect.
172
172
* Represented as an [x, y] array of two floats.
173
173
* [1, 1] means the prop moves 1:1 with the camera.
174
- * [0.5, 0.5] means the prop half as much as the camera.
174
+ * [0.5, 0.5] means the prop moves half as much as the camera.
175
175
* [0, 0] means the prop is not moved.
176
176
* @default [0, 0]
177
177
*/
@@ -261,4 +261,24 @@ typedef StageDataCharacter =
261
261
*/
262
262
@:optional
263
263
var cameraOffsets : Array <Float >;
264
+
265
+ /**
266
+ * How much the character scrolls relative to the camera. Used to create a parallax effect.
267
+ * Represented as an [x, y] array of two floats.
268
+ * [1, 1] means the character moves 1:1 with the camera.
269
+ * [0.5, 0.5] means the character moves half as much as the camera.
270
+ * [0, 0] means the character is not moved.
271
+ * @default [0, 0]
272
+ */
273
+ @:optional
274
+ @:default ([0 , 0 ])
275
+ var scroll : Array <Float >;
276
+
277
+ /**
278
+ * The alpha of the character, as a float.
279
+ * @default 1.0
280
+ */
281
+ @:optional
282
+ @:default (1.0 )
283
+ var alpha : Float ;
264
284
};
Original file line number Diff line number Diff line change @@ -454,6 +454,11 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements
454
454
character .cameraFocusPoint .x + = stageCharData .cameraOffsets [0 ];
455
455
character .cameraFocusPoint .y + = stageCharData .cameraOffsets [1 ];
456
456
457
+ character .scrollFactor .x + = stageCharData .scroll [0 ];
458
+ character .scrollFactor .y + = stageCharData .scroll [1 ];
459
+
460
+ character .alpha = stageCharData .alpha ;
461
+
457
462
#if FEATURE_DEBUG_FUNCTIONS
458
463
// Draw the debug icon at the character's feet.
459
464
if (charType == BF || charType == DAD )
You can’t perform that action at this time.
0 commit comments