From cd2b458da2ed2eeea46893dfccbb289f34ee8415 Mon Sep 17 00:00:00 2001 From: AbnormalPoof Date: Fri, 27 Sep 2024 15:15:35 -0500 Subject: [PATCH] add flipx and flipy --- source/funkin/data/stage/StageData.hx | 16 ++++++++++++++++ source/funkin/play/stage/Stage.hx | 3 +++ 2 files changed, 19 insertions(+) diff --git a/source/funkin/data/stage/StageData.hx b/source/funkin/data/stage/StageData.hx index eda8e3148..1e9172b00 100644 --- a/source/funkin/data/stage/StageData.hx +++ b/source/funkin/data/stage/StageData.hx @@ -118,6 +118,22 @@ typedef StageDataProp = @:default(false) var isPixel:Bool; + /** + * If set to true, the prop will be flipped horizontally. + * @default false + */ + @:optional + @:default(false) + var flipX:Bool; + + /** + * If set to true, the prop will be flipped vertically. + * @default false + */ + @:optional + @:default(false) + var flipY:Bool; + /** * Either the scale of the prop as a float, or the [w, h] scale as an array of two floats. * Pro tip: On pixel-art levels, save the sprite small and set this value to 6 or so to save memory. diff --git a/source/funkin/play/stage/Stage.hx b/source/funkin/play/stage/Stage.hx index c42e41cad..c237005cf 100644 --- a/source/funkin/play/stage/Stage.hx +++ b/source/funkin/play/stage/Stage.hx @@ -258,6 +258,9 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements propSprite.zIndex = dataProp.zIndex; + propSprite.flipX = dataProp.flipX; + propSprite.flipY = dataProp.flipY; + switch (dataProp.animType) { case 'packer':