Closed SeiferTim closed 11 years ago
Hm, it does stop, but it's like.... if my left bound = 0 then it treats it as -160...
I 'fixed' it by changing:
if (zoom > 1)
to
if (zoom > 1 && zoom != defaultZoom)
in FlxCamera.as on line 327... This might only work for me since my camera's zoom is the same as my defaultZoom...
That if (zoom > 1)
you changed was added with this pull request. Do you have any code I can use to test your fix and investigate the problem even further, @SeiferTim ?
Um, I don't really have any simple code to share - I stuck this new version into an already coded project and that's when I noticed the problem.
I, too switched to Flixel Community on an existing large project, and the camera began behaving like this for me as well. I'll see if I can dig some relevant bounds/camera code out of it that might help
Here are my dimensions/pixel resolution/etc. from my main main FlxGame-extending class:
super(320, 240, MenuState, 2); FlxG.worldBounds = new FlxRect(0, 0, 3000, 480);
Here's my camera setup code from my FlxState-extending game state:
private function setupCamera():void { FlxG.camera.follow(Game.player,2.5); FlxG.camera.setBounds(0,0,3000,480); }
That's all I can think of offhand that might be relevant. Hope it helps!
Thanks for the hints, guys! I will investigate the problem.
Added note: SeiferTim's fix didn't have any effect in my case
I'll see about trying older versions til the problem goes away, and see if I can pinpoint any more insight for you
Update: I've determined which commit introduces the bug: https://github.com/FlixelCommunity/flixel/commit/6f3ca287f01f82167eebb9c7cbf8e3df3738a085#org/flixel/FlxCamera.as
It's been in place for 7 months, so it must be fairly obscure
I will revert the commit that introduced the bug. The camera should behave properly again.
I've just merged the fix https://github.com/FlixelCommunity/flixel/commit/3c49912072abdbd66f01c3cc361f5fa671303e87 . The camera should work properly again.
Trying to check out the lastest version of the Community code, and most everything seems to be working fine, except that the bounds I'm setting on my camera no longer seem to work...?
Previously, if I said
FlxG.camera.setBounds(0,0,1000,800);
then I have a FlxSprite that is set to be followed, when it gets to the far left, the camera will stop without showing anything with x < 0... that is no longer true...