Skip to content

Commit 17cc888

Browse files
committed
Add blend mode support for flxanimate
1 parent e2a3951 commit 17cc888

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

art/generateDoc.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@ECHO OFF
22
cd ..
33
echo Building Game...
4-
lime build windows --haxeflag="--macro include('scripting')" --haxeflag="-xml docs/doc.xml" -D DOCUMENTATION --no-output
4+
lime build windows --haxeflag="-xml docs/doc.xml" -D doc-gen -D DOCUMENTATION --no-output
55
echo art
66

77
echo Generated the api xml file at docs/doc.xml

source/funkin/backend/FlxAnimate.hx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ import flixel.math.FlxAngle;
77
import flixel.math.FlxRect;
88
import flixel.graphics.frames.FlxFrame;
99
import flixel.math.FlxPoint;
10+
import openfl.display.BlendMode;
1011

1112
class FlxAnimate extends flxanimate.FlxAnimate {
1213
static var rMatrix = new FlxMatrix();
1314

14-
override function drawLimb(limb:FlxFrame, _rMatrix:FlxMatrix, ?colorTransform:ColorTransform)
15+
override function drawLimb(limb:FlxFrame, _rMatrix:FlxMatrix, ?colorTransform:ColorTransform, ?blendMode:BlendMode)
1516
{
1617
if (alpha == 0 || colorTransform != null && (colorTransform.alphaMultiplier == 0 || colorTransform.alphaOffset == -255) || limb == null || limb.type == EMPTY)
1718
return;
19+
20+
if (blendMode != null)
21+
blendMode = BlendMode.NORMAL;
22+
1823
for (camera in cameras)
1924
{
2025
rMatrix.identity();
@@ -69,7 +74,7 @@ class FlxAnimate extends flxanimate.FlxAnimate {
6974
}
7075

7176
rMatrix.translate(_point.x, _point.y);
72-
camera.drawPixels(limb, null, rMatrix, colorTransform, blend, antialiasing, shaderEnabled ? shader : null);
77+
camera.drawPixels(limb, null, rMatrix, colorTransform, blendMode, antialiasing, shaderEnabled ? shader : null);
7378
#if FLX_DEBUG
7479
FlxBasic.visibleCount++;
7580
#end

0 commit comments

Comments
 (0)