Skip to content

Commit

Permalink
better long term solution for sprite group cameras (HaxeFlixel#3116)
Browse files Browse the repository at this point in the history
* better long term solution for sprite group cameras

* prepare release
  • Loading branch information
Geokureli authored Apr 17, 2024
1 parent 5a090ea commit c17dd67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
5.7.2 (April 17, 2024)
#### Bugfixes:
- `FlxSpriteGroup`: Better long term fix for members cameras ([#3116](https://github.com/HaxeFlixel/flixel/pull/3116))

5.7.1 (April 16, 2024)
#### Bugfixes:
- `FlxImageFrame`: Prevent null ref from destroyed graphics ([#3113](https://github.com/HaxeFlixel/flixel/pull/3113))
Expand Down
4 changes: 1 addition & 3 deletions flixel/group/FlxSpriteGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class FlxTypedSpriteGroup<T:FlxSprite> extends FlxSprite
sprite.y += y;
sprite.alpha *= alpha;
sprite.scrollFactor.copyFrom(scrollFactor);
sprite._cameras = _cameras; // _cameras instead of cameras because get_cameras() will not return null
sprite.cameras = _cameras; // _cameras instead of cameras because get_cameras() will not return null

if (clipRect != null)
clipRectTransform(sprite, clipRect);
Expand Down Expand Up @@ -679,15 +679,13 @@ class FlxTypedSpriteGroup<T:FlxSprite> extends FlxSprite
{
if (camera != Value)
transformChildren(cameraTransform, Value);
group.camera = Value;
return super.set_camera(Value);
}

override function set_cameras(Value:Array<FlxCamera>):Array<FlxCamera>
{
if (_cameras != Value)
transformChildren(camerasTransform, Value);
group.cameras = Value;
return super.set_cameras(Value);
}

Expand Down
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"license": "MIT",
"tags": ["game", "openfl", "flash", "html5", "neko", "cpp", "android", "ios", "cross"],
"description": "HaxeFlixel is a 2D game engine based on OpenFL that delivers cross-platform games.",
"version": "5.7.1",
"releasenote": "Fix sprite group cameras",
"version": "5.7.2",
"releasenote": "Better long term fix for spritegroup cameras",
"contributors": ["haxeflixel", "Gama11", "GeoKureli"],
"dependencies": {}
}

0 comments on commit c17dd67

Please sign in to comment.