diff --git a/source/funkin/data/stage/StageData.hx b/source/funkin/data/stage/StageData.hx index 5ac22ca90..6fb6a8caf 100644 --- a/source/funkin/data/stage/StageData.hx +++ b/source/funkin/data/stage/StageData.hx @@ -171,7 +171,7 @@ typedef StageDataProp = * How much the prop scrolls relative to the camera. Used to create a parallax effect. * Represented as an [x, y] array of two floats. * [1, 1] means the prop moves 1:1 with the camera. - * [0.5, 0.5] means the prop half as much as the camera. + * [0.5, 0.5] means the prop moves half as much as the camera. * [0, 0] means the prop is not moved. * @default [0, 0] */ @@ -261,4 +261,24 @@ typedef StageDataCharacter = */ @:optional var cameraOffsets:Array<Float>; + + /** + * How much the character scrolls relative to the camera. Used to create a parallax effect. + * Represented as an [x, y] array of two floats. + * [1, 1] means the character moves 1:1 with the camera. + * [0.5, 0.5] means the character moves half as much as the camera. + * [0, 0] means the character is not moved. + * @default [0, 0] + */ + @:optional + @:default([0, 0]) + var scroll:Array<Float>; + + /** + * The alpha of the character, as a float. + * @default 1.0 + */ + @:optional + @:default(1.0) + var alpha:Float; }; diff --git a/source/funkin/play/stage/Stage.hx b/source/funkin/play/stage/Stage.hx index d96fe128d..04a2a2ae4 100644 --- a/source/funkin/play/stage/Stage.hx +++ b/source/funkin/play/stage/Stage.hx @@ -454,6 +454,11 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements character.cameraFocusPoint.x += stageCharData.cameraOffsets[0]; character.cameraFocusPoint.y += stageCharData.cameraOffsets[1]; + character.scrollFactor.x += stageCharData.scroll[0]; + character.scrollFactor.y += stageCharData.scroll[1]; + + character.alpha = stageCharData.alpha; + #if FEATURE_DEBUG_FUNCTIONS // Draw the debug icon at the character's feet. if (charType == BF || charType == DAD)