Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlxSpriteGroup: add camera setter override, closes #2144 #2146

Merged
merged 1 commit into from
Apr 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions flixel/group/FlxSpriteGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,13 @@ class FlxTypedSpriteGroup<T:FlxSprite> extends FlxSprite

// PROPERTIES GETTERS/SETTERS

override private function set_camera(Value:FlxCamera):FlxCamera
{
if (camera != Value)
transformChildren(cameraTransform, Value);
return super.set_camera(Value);
}

override private function set_cameras(Value:Array<FlxCamera>):Array<FlxCamera>
{
if (cameras != Value)
Expand Down Expand Up @@ -883,6 +890,7 @@ class FlxTypedSpriteGroup<T:FlxSprite> extends FlxSprite
private inline function solidTransform(Sprite:FlxSprite, Solid:Bool) Sprite.solid = Solid;
private inline function aliveTransform(Sprite:FlxSprite, Alive:Bool) Sprite.alive = Alive;
private inline function existsTransform(Sprite:FlxSprite, Exists:Bool) Sprite.exists = Exists;
private inline function cameraTransform(Sprite:FlxSprite, Camera:FlxCamera) Sprite.camera = Camera;
private inline function camerasTransform(Sprite:FlxSprite, Cameras:Array<FlxCamera>) Sprite.cameras = Cameras;

private inline function offsetTransform(Sprite:FlxSprite, Offset:FlxPoint) Sprite.offset.copyFrom(Offset);
Expand Down