-
Notifications
You must be signed in to change notification settings - Fork 480
Use scrollRect to clip filters and position game window #3487
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
base: dev
Are you sure you want to change the base?
Conversation
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it say use inputContainer
instead of just use
?That way users would know the new variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
x = -FlxG.scaleMode.offset.x; | ||
y = -FlxG.scaleMode.offset.y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this needs to be reverted for my change in #3487 (comment), otherwise a portion of the debugger will be off screen
Fixes #2258
Adds a scrollRect to the game to ensure that game filters are the expected size. Also adds public
filteredContainer
,inputContainer
andcameraContainer
fields toFlxGame
while deprecating the old private_inputContainer
field. 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.cameraContainer
directly.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