Phantom image for sprite sheet on alpha
Aug 27 2019 01:46 PM
What could I be doing wrong?
I've done just that, which helped me realized that the problem is more complex than it originally appeared since on an "empty" project the issue does not appear.
I'm attaching the sample with the code I use along with a screenshot of the problematic game.
Problem is likely 'not' complex. This example by itself runs fine in my simulator (which you indicated it would), so the sample code is not helpful in figuring the issue.
I am guessing that somehow in your full-code, you have more then one instance of the 'toggle' on top of another ... maybe one under neath the rect(that has an alpha less then 1) .. thus the lower version of the toggle gets that ghosted look.
just my guess, based on the code you sent ... if that is not the problem, you might need to send more example code.
Best of luck
Based on the project that you uploaded, I completely agree with Bob.
More often than not, when you upload a sample project to demonstrate your issue, but the issue isn't visible there, then it isn't that the problem is complex, but that the problem lies elsewhere in your code. As Bob said, the culprit is likely you creating two sets of buttons and the former is just left below in a semi transparent state and can't be touched anymore since the latter button is positioned in front of it.
This can easily happen if you are creating the button within a loop that you accidentally call twice, or if you are using composer and that code is inside scene:show listener, for instance, and you haven't defined whether the button should be created during "will" or "did" phase, which would lead to it being created twice.