Merge pull request #803 from FunkinCrew/abnormalpoof/stage-prop-flipx

[PUBLIC PR] Add flipX and flipY parameters to Stage props
This commit is contained in:
Cameron Taylor 2024-09-28 12:30:57 -04:00 committed by GitHub
commit a1370157a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 4 deletions

View file

@ -19,7 +19,7 @@ Please check out our [Contributor's guide](./CONTRIBUTORS.md) on how you can act
# Credits and Special Thanks
Full credits can be found in-game, or wherever the credits.json file is.
Full credits can be found in-game, or in the `credits.json` file which is located [here](https://github.com/FunkinCrew/funkin.assets/blob/main/exclude/data/credits.json).
## Programming
- [ninjamuffin99](https://twitter.com/ninja_muffin99) - Lead Programmer

View file

@ -6,7 +6,7 @@
"name": "EliteMasterEric"
}
],
"api_version": "0.1.0",
"api_version": "0.5.0",
"mod_version": "1.0.0",
"license": "Apache-2.0"
}

View file

@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.2]
### Added
- Added the ability to specify `flipX` and `flipY` on stage props to horizontally or vertically flip, respectively.
## [1.0.1]
### Added
- Added the ability to specify a hexadecimal color in the `assetPath` field instead of a texture key.

View file

@ -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.

View file

@ -11,9 +11,9 @@ class StageRegistry extends BaseRegistry<Stage, StageData>
* Handle breaking changes by incrementing this value
* and adding migration to the `migrateStageData()` function.
*/
public static final STAGE_DATA_VERSION:thx.semver.Version = "1.0.0";
public static final STAGE_DATA_VERSION:thx.semver.Version = "1.0.2";
public static final STAGE_DATA_VERSION_RULE:thx.semver.VersionRule = "1.0.x";
public static final STAGE_DATA_VERSION_RULE:thx.semver.VersionRule = ">=1.0.0 <=1.0.2";
public static var instance(get, never):StageRegistry;
static var _instance:Null<StageRegistry> = null;

View file

@ -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':