Skip to content

Commit ff56b19

Browse files
AbnormalPoofEliteMasterEric
authored andcommitted
add scrollfactor and alpha + grammatical fix in StageData
1 parent 87b1fc9 commit ff56b19

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

source/funkin/data/stage/StageData.hx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ typedef StageDataProp =
171171
* How much the prop scrolls relative to the camera. Used to create a parallax effect.
172172
* Represented as an [x, y] array of two floats.
173173
* [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.
175175
* [0, 0] means the prop is not moved.
176176
* @default [0, 0]
177177
*/
@@ -261,4 +261,24 @@ typedef StageDataCharacter =
261261
*/
262262
@:optional
263263
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;
264284
};

source/funkin/play/stage/Stage.hx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,11 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements
454454
character.cameraFocusPoint.x += stageCharData.cameraOffsets[0];
455455
character.cameraFocusPoint.y += stageCharData.cameraOffsets[1];
456456

457+
character.scrollFactor.x += stageCharData.scroll[0];
458+
character.scrollFactor.y += stageCharData.scroll[1];
459+
460+
character.alpha = stageCharData.alpha;
461+
457462
#if FEATURE_DEBUG_FUNCTIONS
458463
// Draw the debug icon at the character's feet.
459464
if (charType == BF || charType == DAD)

0 commit comments

Comments
 (0)