Skip to content
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

Just a thought / Concern with "inverted" property calculation in StarlingArt.as #274

Open
Snky opened this issue Nov 27, 2015 · 1 comment

Comments

@Snky
Copy link

Snky commented Nov 27, 2015

Hello, I'm not sure if I'm entirely correct with this, but, I do not use this property personally, and I've actually never had this issue before that I'm about to mention:

After the HandleArtReady is called on a APhysicsObject or CitrusSprite, if I wanted a flipped image, I would just write: sa.scaleX = -1 ( sa being a reference to the StarlingArt instance of that object )


So now inside StarlingArt.as, in the update loop, there is:

        if (_citrusObject.inverted) {

            if (scaleX > 0)
                scaleX = -scaleX;

        } else {

            if (scaleX < 0)
                scaleX = -scaleX;
        }

In my scenario, "inverted" is "false", so in the normal StarlingArt loop, it's running the code in the bottom section, and flipping it back from my -1 to +1, so by default, without using inverted it is impossible to set a negative value, without this "inverted" property ( unless you flip the Starling Image directly via say, ( view as image ).scaleX = -1 ).




Shouldn't the "inverted" property just have a "setter" function, that flips it on demand rather than having constant code running in the StarlingArt.as update function?

@alamboley
Copy link
Member

Hey, yes using a setter make totally sense! Will update that next week, thanks for the report ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants