Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
a7dcc5c
add "mod" function to FlxMath (#3341)
cyn0x8 Jan 28, 2025
019acfe
Flixel 6.0.0 (#3346)
Geokureli Jan 31, 2025
6365301
formatting changes to readme and release.sh
Geokureli Feb 1, 2025
348f108
changelog formatting
Geokureli Feb 2, 2025
5745552
feat: add `luminance` variable to FlxColor (#3357)
ninjamuffin99 Feb 4, 2025
c1d6b25
precise volume change callbacks (#3360)
Feb 8, 2025
9b2c998
fix: Properly parse Int/Floats in the debugger watch on HTML5 (#3328)
ninjamuffin99 Feb 9, 2025
14385b3
gc-free group iterator (#3362)
Sword352 Feb 12, 2025
9875460
Fix distanceSquaredTo (#3365)
oscarcederberg Feb 14, 2025
46dabbb
fix flash camera size (#3370)
Geokureli Feb 18, 2025
2601ce2
use UV rect for better clarity (#3371)
Geokureli Feb 18, 2025
6a2d6ef
Query max texture size only once instead of every time it's needed. (…
EliteMasterEric Feb 18, 2025
fa00ba4
Small improvements to debug windows (#3374)
Geokureli Feb 21, 2025
ec746de
Improve debug windows (#3375)
Geokureli Feb 21, 2025
a2295f2
Refactor debug windows (#3376)
Geokureli Feb 26, 2025
db6a5de
FlxSprite: Allow changes to cliprect to take effect without setter (#…
Geokureli Feb 27, 2025
8591ad4
FlxRect: Add FlxReadOnlyRect and setAbs/setBounds (#3382)
Geokureli Feb 27, 2025
8ed225c
Add custom text option to FlxSoundTray (#3378)
slameron Feb 28, 2025
9160dc8
check cliprect changes earlier (#3387)
Geokureli Mar 5, 2025
19e9424
fix cliprect on scaled members in FlxSpriteGroup (#3388)
slameron Mar 6, 2025
f4e3ea2
Cliprect fix (#3390)
Geokureli Mar 7, 2025
9ee75a9
simple enabled check (#3393)
DetectiveBaldi Mar 10, 2025
48833dc
Update FlxBGSprite.hx (#3397)
MaybeMaru Mar 12, 2025
3064087
FlxBitmapText: add autoBounds (#3396)
Geokureli Mar 13, 2025
e8205ac
FlxDebugger: Add scale and defaultScale (#3399)
Geokureli Mar 13, 2025
f0e0ddb
fix `persist` behavior (#3400)
Sword352 Mar 16, 2025
e0c4cb4
Update changelog
Geokureli Mar 20, 2025
8126fc5
Don't clear the asset key when destroying an FlxGraphic (#3402)
EliteMasterEric Mar 27, 2025
47e69f8
FlxSprite: update clipRect documentation (#3403)
ACrazyTown Mar 27, 2025
c7bf42a
Improve FlxBitmapText rendering when using renderTile with clipRect (…
Geokureli Mar 28, 2025
e42d9bc
Update FlxSound.hx (#3406)
TheGaloXx Mar 31, 2025
2418e14
Warn when `FLX_HEALTH` or `FLX_NO_HEALTH` is not defined, deprecate `…
Geokureli Apr 1, 2025
cb54aa9
FlxBitmapText: Fix Incorrect alpha behavior (#3409)
BoloVEVO Apr 2, 2025
b6d78d4
Fix mention of removed setFilters() function (#3412)
ACrazyTown Apr 4, 2025
0d72dc2
Fix FlxSubState bg color rendering on the incorrect camera (#3415)
MaybeMaru Apr 16, 2025
b99e311
logarithmic volume control for global soundtray / volume (#3248)
ninjamuffin99 Apr 21, 2025
3838fb8
Update FlxCamera.hx (#3356)
Cheemsandfriends Apr 21, 2025
aad5a15
Add muted property to FlxSoundGroup (#3421)
ACrazyTown Apr 24, 2025
9eed6e3
Replace a dead link in the docs with an archived version (#3424)
Vortex2Oblivion Apr 27, 2025
199db02
update changelog
Geokureli Apr 28, 2025
4081a9f
Improve `FlxSprite` color transform handling, deprecate `FlxColor.to2…
richTrash21 Apr 28, 2025
6f6a6e3
release 6.1.0
Geokureli Apr 28, 2025
8ab366e
typo
Geokureli Apr 28, 2025
200d7cd
Add PS5 / DualSense controller model support (#3380)
slameron Apr 28, 2025
e356bd2
Improve crash message for attempting to access a destroyed graphic (#…
VioletSnowLeopard Apr 29, 2025
f5fc836
Piecewise axis separate (#3418)
MondayHopscotch May 6, 2025
91c91ee
Update FlxSprite.hx (#3435)
Vortex2Oblivion May 25, 2025
2046936
add null check (#3436)
DetectiveBaldi May 29, 2025
2e8a38b
chore: add null-safety to FlxTouchManager (#3440)
NotHyper-474 Jul 1, 2025
145186d
Fixing issue with `preUpdate` signal being called before `updateInput…
ItsLJcool Jul 6, 2025
83aec8e
Better pixel font support for FlxText (#3453)
ACrazyTown Jul 28, 2025
c8f35b6
Don't inline MatrixVector.set on Hashlink (#3454)
rifxii Jul 30, 2025
c9ae61e
Fix alpha channel (#3455)
picnicpip Jul 31, 2025
038937a
Make result optional in calcRectExit (#3448)
Geokureli Aug 2, 2025
f6a98e3
Fix function description in FlxMath (#3457)
glintfishGH Aug 5, 2025
6f8ee63
Remove getHandler() hashlink conditional (#3458)
rifxii Aug 14, 2025
c27d279
Replace mention to renamed property (#3460)
ACrazyTown Aug 16, 2025
9232795
Fix typos in FlxUVRect (#3475)
Geokureli Sep 12, 2025
6f9ab24
update uv in clip() (#3476)
Geokureli Sep 14, 2025
a98a969
Update FlxCamera.hx (#3481)
DetectiveBaldi Sep 17, 2025
c6881bb
use view bounds in drawTriangles (#3484)
richTrash21 Sep 17, 2025
c8770f3
add unit tests for #3436 (#3485)
Geokureli Sep 17, 2025
e1c49b8
FlxDrawQuadsItem: call endFill() after drawing (#3462)
ACrazyTown Sep 17, 2025
2da26e1
Remove references to unused "blending" variable (#3467)
ACrazyTown Sep 21, 2025
5b12ed2
fix mouse quirk when showing/hiding debugger
Geokureli Sep 25, 2025
06413e6
Revert "fix mouse quirk when showing/hiding debugger"
Geokureli Sep 25, 2025
57b688f
`FlxSound`: Prevent paused sounds resuming on focus (#3316)
Geokureli Sep 25, 2025
ce80660
prepare 6.1.1
Geokureli Sep 25, 2025
c4cc07c
Improve zoomed debug hitboxes performance (#3449)
MaybeMaru Sep 27, 2025
4b6a931
Merge branch 'dev' into merge-from-dev
AbnormalPoof Oct 1, 2025
49d20d7
revert 3418 (#3500)
Geokureli Oct 3, 2025
66721b0
remove piece-wise collision from changelog
Geokureli Oct 3, 2025
7177aeb
account for zoom when drawing debug tilemaps (#3504)
Geokureli Oct 7, 2025
b46850c
prepare release
Geokureli Oct 7, 2025
7d30796
fixed watch window position (#3506)
dtwotwo Oct 8, 2025
08e7225
fix camera filter memory leak (#3459)
cyn0x8 Oct 8, 2025
ddde59e
`FlxCamera`: Honor color transformation in `drawTriangles` on `FlxG.r…
richTrash21 Oct 10, 2025
a806c50
Merge remote-tracking branch 'upstream/dev' into merge-from-dev
MAJigsaw77 Oct 12, 2025
47d7960
Add this back oops
MAJigsaw77 Oct 12, 2025
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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
"haxeTestExplorer.testCommand": [
"haxelib", "run", "lime", "test", "tests/unit/project.xml", "cpp", "--haxelib=test-adapter"
]
}
}
971 changes: 530 additions & 441 deletions CHANGELOG.md

Large diffs are not rendered by default.

Binary file modified assets/images/debugger/buttons/bitmapLog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 23 additions & 39 deletions flixel/FlxCamera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class FlxCamera extends FlxBasic
public var followLead(default, null):FlxPoint = FlxPoint.get();

/**
* Enables or disables the filters set via `setFilters()`.
* Enables or disables the filters set via the `filters` array.
*/
public var filtersEnabled:Bool = true;

Expand Down Expand Up @@ -579,14 +579,12 @@ class FlxCamera extends FlxBasic
return startTrianglesBatch(graphic, smooth, colored, blend);
#else
var itemToReturn = null;
var blendInt:Int = FlxDrawBaseItem.blendToInt(blend);

if (_currentDrawItem != null
&& _currentDrawItem.type == FlxDrawItemType.TILES
&& _headTiles.graphics == graphic
&& _headTiles.colored == colored
&& _headTiles.hasColorOffsets == hasColorOffsets
&& _headTiles.blending == blendInt
&& _headTiles.blend == blend
&& _headTiles.antialiasing == smooth
&& _headTiles.shader == shader)
Expand All @@ -608,13 +606,12 @@ class FlxCamera extends FlxBasic

// TODO: catch this error when the dev actually messes up, not in the draw phase
if (graphic.isDestroyed)
throw 'Attempted to queue an invalid FlxDrawItem, did you destroy a cached sprite?';
throw 'Cannot queue ${graphic.key}. This sprite was destroyed.';

itemToReturn.graphics = graphic;
itemToReturn.antialiasing = smooth;
itemToReturn.colored = colored;
itemToReturn.hasColorOffsets = hasColorOffsets;
itemToReturn.blending = blendInt;
itemToReturn.blend = blend;
itemToReturn.shader = shader;

Expand All @@ -640,19 +637,14 @@ class FlxCamera extends FlxBasic
@:noCompletion
public function startTrianglesBatch(graphic:FlxGraphic, smoothing:Bool = false, isColored:Bool = false, ?blend:BlendMode, ?hasColorOffsets:Bool, ?shader:FlxShader):FlxDrawTrianglesItem
{
var blendInt:Int = FlxDrawBaseItem.blendToInt(blend);

if (_currentDrawItem != null
&& _currentDrawItem.type == FlxDrawItemType.TRIANGLES
&& _headTriangles.graphics == graphic
&& _headTriangles.antialiasing == smoothing
&& _headTriangles.colored == isColored
&& _headTriangles.blending == blendInt
&& _headTriangles.blend == blend
#if !flash
&& _headTriangles.hasColorOffsets == hasColorOffsets
&& _headTriangles.shader == shader
#end
)
{
return _headTriangles;
Expand All @@ -665,7 +657,6 @@ class FlxCamera extends FlxBasic
public function getNewDrawTrianglesItem(graphic:FlxGraphic, smoothing:Bool = false, isColored:Bool = false, ?blend:BlendMode, ?hasColorOffsets:Bool, ?shader:FlxShader):FlxDrawTrianglesItem
{
var itemToReturn:FlxDrawTrianglesItem = null;
var blendInt:Int = FlxDrawBaseItem.blendToInt(blend);

if (_storageTrianglesHead != null)
{
Expand All @@ -682,12 +673,9 @@ class FlxCamera extends FlxBasic
itemToReturn.graphics = graphic;
itemToReturn.antialiasing = smoothing;
itemToReturn.colored = isColored;
itemToReturn.blending = blendInt;
itemToReturn.blend = blend;
#if !flash
itemToReturn.hasColorOffsets = hasColorOffsets;
itemToReturn.shader = shader;
#end

itemToReturn.nextTyped = _headTriangles;
_headTriangles = itemToReturn;
Expand Down Expand Up @@ -743,6 +731,8 @@ class FlxCamera extends FlxBasic
@:allow(flixel.system.frontEnds.CameraFrontEnd)
function render():Void
{
flashSprite.filters = filtersEnabled ? filters : null;

var currItem:FlxDrawBaseItem<Dynamic> = _headOfDrawStack;
while (currItem != null)
{
Expand Down Expand Up @@ -771,7 +761,7 @@ class FlxCamera extends FlxBasic
}
else
{
var isColored = (transform != null && transform.hasRGBMultipliers());
var isColored = (transform != null #if !html5 && transform.hasRGBMultipliers() #end);
var hasColorOffsets:Bool = (transform != null && transform.hasRGBAOffsets());

#if FLX_RENDER_TRIANGLE
Expand Down Expand Up @@ -830,13 +820,13 @@ class FlxCamera extends FlxBasic
public function drawTriangles(graphic:FlxGraphic, vertices:DrawData<Float>, indices:DrawData<Int>, uvtData:DrawData<Float>, ?colors:DrawData<Int>,
?position:FlxPoint, ?blend:BlendMode, repeat:Bool = false, smoothing:Bool = false, ?transform:ColorTransform, ?shader:FlxShader):Void
{
final cameraBounds = _bounds.set(viewMarginLeft, viewMarginTop, viewWidth, viewHeight);

if (FlxG.renderBlit)
{
if (position == null)
position = renderPoint.set();

_bounds.set(0, 0, width, height);

var verticesLength:Int = vertices.length;
var currentVertexPosition:Int = 0;

Expand Down Expand Up @@ -867,7 +857,7 @@ class FlxCamera extends FlxBasic

position.putWeak();

if (!_bounds.overlaps(bounds))
if (!cameraBounds.overlaps(bounds))
{
drawVertices.splice(drawVertices.length - verticesLength, verticesLength);
}
Expand All @@ -887,7 +877,8 @@ class FlxCamera extends FlxBasic
_helperMatrix.translate(-viewMarginLeft, -viewMarginTop);
}

buffer.draw(trianglesSprite, _helperMatrix);
buffer.draw(trianglesSprite, _helperMatrix, transform);

#if FLX_DEBUG
if (FlxG.debugger.drawDebug)
{
Expand All @@ -905,18 +896,11 @@ class FlxCamera extends FlxBasic
}
else
{
_bounds.set(0, 0, width, height);
var isColored:Bool = (colors != null && colors.length != 0);
final isColored = (colors != null && colors.length != 0) || (transform != null && transform.hasRGBMultipliers());
final hasColorOffsets = (transform != null && transform.hasRGBAOffsets());

#if !flash
var hasColorOffsets:Bool = (transform != null && transform.hasRGBAOffsets());
isColored = isColored || (transform != null && transform.hasRGBMultipliers());
var drawItem:FlxDrawTrianglesItem = startTrianglesBatch(graphic, smoothing, isColored, blend, hasColorOffsets, shader);
drawItem.addTriangles(vertices, indices, uvtData, colors, position, _bounds, transform);
#else
var drawItem:FlxDrawTrianglesItem = startTrianglesBatch(graphic, smoothing, isColored, blend);
drawItem.addTriangles(vertices, indices, uvtData, colors, position, _bounds);
#end
final drawItem = startTrianglesBatch(graphic, smoothing, isColored, blend, hasColorOffsets, shader);
drawItem.addTriangles(vertices, indices, uvtData, colors, position, cameraBounds, transform);
}
}

Expand Down Expand Up @@ -1016,8 +1000,13 @@ class FlxCamera extends FlxBasic
zoom = defaultZoom;

// Use the game dimensions if width / height are <= 0
this.width = width <= 0 ? Math.ceil(FlxG.width / zoom) : width;
this.height = height <= 0 ? Math.ceil(FlxG.height / zoom) : height;
if (width <= 0)
width = Math.ceil(FlxG.width / zoom);
if (height <= 0)
height = Math.ceil(FlxG.height / zoom);

this.width = width;
this.height = height;
_flashRect = new Rectangle(0, 0, width, height);

flashSprite.addChild(_scrollRect);
Expand Down Expand Up @@ -1101,7 +1090,7 @@ class FlxCamera extends FlxBasic
_helperPoint = null;
}

_bounds = null;
_bounds = FlxDestroyUtil.put(_bounds);
scroll = FlxDestroyUtil.put(scroll);
targetOffset = FlxDestroyUtil.put(targetOffset);
deadzone = FlxDestroyUtil.put(deadzone);
Expand Down Expand Up @@ -1134,8 +1123,6 @@ class FlxCamera extends FlxBasic
updateFlash(elapsed);
updateFade(elapsed);

flashSprite.filters = filtersEnabled ? filters : null;

updateFlashSpritePosition();
updateShake(elapsed);
}
Expand Down Expand Up @@ -1671,9 +1658,6 @@ class FlxCamera extends FlxBasic
}
else
{
if (FxAlpha == 0)
return;

final targetGraphics = (graphics == null) ? canvas.graphics : graphics;

targetGraphics.overrideBlendMode(null);
Expand Down Expand Up @@ -1702,7 +1686,7 @@ class FlxCamera extends FlxBasic
}
else
{
final alpha = color.alphaFloat * _fxFlashAlpha;
final alpha = _fxFlashColor.alphaFloat * _fxFlashAlpha;
fill(_fxFlashColor.rgb, true, alpha, canvas.graphics);
}
}
Expand Down
3 changes: 2 additions & 1 deletion flixel/FlxG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import flixel.input.FlxGyroscope;
#if FLX_POINTER_INPUT
import flixel.input.FlxSwipe;
#end

#if html5
import flixel.system.frontEnds.HTML5FrontEnd;
#end
Expand Down Expand Up @@ -102,7 +103,7 @@ class FlxG
* The HaxeFlixel version, in semantic versioning syntax. Use `Std.string()`
* on it to get a `String` formatted like this: `"HaxeFlixel MAJOR.MINOR.PATCH-COMMIT_SHA"`.
*/
public static var VERSION(default, null):FlxVersion = new FlxVersion(5, 9, 0);
public static final VERSION = new FlxVersion(6, 1, 1);

/**
* Internal tracker for game object.
Expand Down
4 changes: 2 additions & 2 deletions flixel/FlxGame.hx
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,9 @@ class FlxGame extends Sprite

updateElapsed();

FlxG.signals.preUpdate.dispatch();

updateInput();

FlxG.signals.preUpdate.dispatch();

#if FLX_SOUND_SYSTEM
FlxG.sound.update(FlxG.elapsed);
Expand Down
38 changes: 29 additions & 9 deletions flixel/FlxObject.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package flixel;

import openfl.display.Graphics;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
Expand All @@ -13,6 +12,7 @@ import flixel.util.FlxDestroyUtil;
import flixel.util.FlxDirectionFlags;
import flixel.util.FlxSpriteUtil;
import flixel.util.FlxStringUtil;
import openfl.display.Graphics;

/**
* At their core `FlxObjects` are just boxes with positions that can move and collide with other
Expand Down Expand Up @@ -46,7 +46,7 @@ import flixel.util.FlxStringUtil;
* FlxG.overlap(playerGroup, medKitGroup
* function onOverlap(player, medKit)
* {
* player.health = 100;
* player.heal(100);
* medKit.kill();
* }
* );
Expand Down Expand Up @@ -670,7 +670,9 @@ class FlxObject extends FlxBasic
/**
* Handy for storing health percentage or armor points or whatever.
*/
@:deprecated("object.health is being removed in version 6.0.0")
#if FLX_HEALTH_NOT_DEFINED
@:deprecated("object.health is deprecated, add <haxedef name=\"FLX_HEALTH\"/> in your project.xml to continue using it")
#end
public var health:Float = 1;
#end

Expand Down Expand Up @@ -1160,7 +1162,10 @@ class FlxObject extends FlxBasic
*
* @param Damage How much health to take away (use a negative number to give a health bonus).
*/
@:deprecated("object.health is being removed in version 6.0.0")

#if FLX_HEALTH_NOT_DEFINED
@:deprecated("object.hurt is deprecated, add <haxedef name=\"FLX_HEALTH\"/> in your project.xml to continue using it")
#end
public function hurt(damage:Float):Void
{
health = health - damage;
Expand Down Expand Up @@ -1241,10 +1246,25 @@ class FlxObject extends FlxBasic
if (!camera.visible || !camera.exists || !isOnScreen(camera))
return;

var rect = getBoundingBox(camera);
var gfx:Graphics = beginDrawDebug(camera);
drawDebugBoundingBox(gfx, rect, allowCollisions, immovable);
endDrawDebug(camera);
final rect = getBoundingBox(camera);
if (FlxG.renderTile)
{
final PAD = 2;
final view = camera.getViewMarginRect();
view.left -= PAD;
view.top -= PAD;
view.right += PAD;
view.bottom += PAD;
rect.clipTo(view);
view.put();
}

if (rect.width > 0 && rect.height > 0)
{
final gfx = beginDrawDebug(camera);
drawDebugBoundingBox(gfx, rect, allowCollisions, immovable);
endDrawDebug(camera);
}
}

function drawDebugBoundingBox(gfx:Graphics, rect:FlxRect, allowCollisions:FlxDirectionFlags, partial:Bool)
Expand Down Expand Up @@ -1272,7 +1292,7 @@ class FlxObject extends FlxBasic
function drawDebugBoundingBoxColor(gfx:Graphics, rect:FlxRect, color:FlxColor)
{
// fill static graphics object with square shape
gfx.lineStyle(1, color, 0.75);
gfx.lineStyle(1, color, 0.75, false, null, null, MITER, 255);
gfx.drawRect(rect.x + 0.5, rect.y + 0.5, rect.width - 1.0, rect.height - 1.0);
}

Expand Down
Loading