FlixelCommunity / Flixel-Power-Tools

The Flixel Power Tools are a package of classes designed to provide extra functionality to your Flixel games. Originally created by Richard Davey (Photon Storm), this is the Flixel Community fork of the library, striving to keep the library living and up to date with the latest version of Flixel.
http://www.photonstorm.com/flixel-power-tools
Other
8 stars 3 forks source link

[CLOSED] FlxScrollZone - onlyScrollOnscreen = false not working #2

Closed FlixelCommunityBot closed 10 years ago

FlixelCommunityBot commented 10 years ago

Issue by SeiferTim from Monday May 16, 2011 at 18:05 GMT Originally opened as https://github.com/photonstorm/Flixel-Power-Tools/issues/2


Trying to setup a sprite that's on a different camera from the default. Even when I set onlyScrollOnscreen to false it wouldn't scroll. It looks like the draw() function is incorrectly checking if the user wants to override onScreen() checks: if ((obj.onScreenScroller == true && obj.source.onScreen()) && obj.scrolling == true && obj.source.exists) Should be: if ((obj.onScreenScroller == false || obj.source.onScreen()) && obj.scrolling == true && obj.source.exists)

FlixelCommunityBot commented 10 years ago

Comment by photonstorm from Monday May 16, 2011 at 18:58 GMT


Actually I think it's just a logic thing in the way I named the parameter that makes it confusing. I have renamed the parameter from "onScreenScroller" to "onlyScrollOnscreen" and the following draw code now works fine (and makes more logical sense):

if ((obj.onlyScrollOnscreen == true && obj.source.onScreen()) && obj.scrolling == true && obj.source.exists)

Thanks for forcing me to change this :) It's on v1.4 which I'll upload later.