Use scrollRect to clip filters and position game window#3487
Draft
Geokureli wants to merge 1 commit intoHaxeFlixel:devfrom
Draft
Use scrollRect to clip filters and position game window#3487Geokureli wants to merge 1 commit intoHaxeFlixel:devfrom
Geokureli wants to merge 1 commit intoHaxeFlixel:devfrom
Conversation
Member
Author
|
@ACrazyTown originally I wasn't going to add the new containers, but this didn't work without it, specifically with |
| @:allow(flixel.FlxG) | ||
| @:allow(flixel.system.frontEnds.CameraFrontEnd) | ||
| var _inputContainer:Sprite; | ||
| @:deprecated("_inputContainer is deprecated, use") |
There was a problem hiding this comment.
Shouldn't it say use inputContainer instead of just use?That way users would know the new variable.
ACrazyTown
reviewed
Sep 22, 2025
Contributor
There was a problem hiding this comment.
Not sure what you meant by "figure out why resizing the window messes this up" but when testing this, I noticed that the sound tray and mouse were offset. Replacing this block with:
FlxG.game.x = offset.x;
FlxG.game.y = offset.y;
final rect = FlxG.game.filteredContainer.scrollRect;
rect.setTo(0, 0, gameSize.x, gameSize.y);
FlxG.game.filteredContainer.scrollRect = rect;seemed to fix things for me.
ACrazyTown
reviewed
Sep 22, 2025
Comment on lines
-328
to
-329
| x = -FlxG.scaleMode.offset.x; | ||
| y = -FlxG.scaleMode.offset.y; |
Contributor
There was a problem hiding this comment.
Also this needs to be reverted for my change in #3487 (comment), otherwise a portion of the debugger will be off screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2258
Adds a scrollRect to the game to ensure that game filters are the expected size. Also adds public
filteredContainer,inputContainerandcameraContainerfields toFlxGamewhile deprecating the old private_inputContainerfield. This is both to show the debugger above the game filters and organize things better so that the dev can simply add filters toFlxG.game.cameraContainerdirectly.I tested this with the ScaleModes demo and it seems to work for every mode.
TODO: figure out why resizing the window messes this up even though the rect values are as expected