Skip to content

Commit

Permalink
FlxCamera: make the filters array public (#2890)
Browse files Browse the repository at this point in the history
* Add a bunch of filter functions for FlxCamera

* Make the filters array public

* Update FlxCamera.hx

* Geokureli's request

* Update FlxCamera.hx

* Update FlxCamera.hx

* Update FlxCamera.hx

* Update FlxCamera.hx
  • Loading branch information
Sword352 authored Aug 15, 2023
1 parent d17918d commit ab3dbfc
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions flixel/FlxCamera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,12 @@ class FlxCamera extends FlxBasic
var _point:FlxPoint = FlxPoint.get();

/**
* Internal, the filters array to be applied to the camera.
* The filters array to be applied to the camera.
*/
var _filters:Array<BitmapFilter>;
public var filters:Null<Array<BitmapFilter>> = null;

@:deprecated("_filters is deprecated, use filters instead")
var _filters(get, set):Null<Array<BitmapFilter>>;

/**
* Camera's initial zoom value. Used for camera's scale handling.
Expand Down Expand Up @@ -1150,7 +1153,7 @@ class FlxCamera extends FlxBasic
updateFlash(elapsed);
updateFade(elapsed);

flashSprite.filters = filtersEnabled ? _filters : null;
flashSprite.filters = filtersEnabled ? filters : null;

updateFlashSpritePosition();
updateShake(elapsed);
Expand Down Expand Up @@ -1594,17 +1597,10 @@ class FlxCamera extends FlxBasic
/**
* Sets the filter array to be applied to the camera.
*/
@:deprecated("setFilters() is deprecated, use the filters array instead")
public function setFilters(filters:Array<BitmapFilter>):Void
{
_filters = filters;
}

/**
* Gets the filter array applied to the camera.
*/
public function getFilters()
{
return _filters;
this.filters = filters;
}

/**
Expand Down Expand Up @@ -2158,6 +2154,16 @@ class FlxCamera extends FlxBasic
{
return viewMarginBottom;
}

inline function get__filters():Array<BitmapFilter>
{
return filters;
}

inline function set__filters(Value:Array<BitmapFilter>):Array<BitmapFilter>
{
return filters = Value;
}

/**
* Do not use the following fields! They only exists because FlxCamera extends FlxBasic,
Expand Down

0 comments on commit ab3dbfc

Please sign in to comment.