Creating an invisible image

I’m having an issue which I’m not sure how to fix. I want to create a new image and immediately make it invisible. I use img.isVisible = false right after I create it, but it still flickers on the screen. I don’t want it to flicker, I just want it not show up at all. Any idea how to make it invisible from the start?

Thanks.

img.alpha = 0 might help

or load it off screen -x,-y then set isVisible then move where you want it

Nope, still flickers.

Doesn’t work either, since newImageRect doesn’t take position. I set the off-screen position after I create it, and it still flickers.

Any other ideas? This should be a simple thing to do.

Use spritesheet

Can you duplicate the problem only coding the image. Maybe the issue is with something else

Have you tried creating a new displaygroup outside of the screen area, and assigning it to that group as part of its creation (as far as I recall, most objects can take a parent argument). It might still create the object and then move it to the display group, causing the flicker though.

It should be simpler than that.

Can you post your code?

  • C

img.alpha = 0 might help

or load it off screen -x,-y then set isVisible then move where you want it

Nope, still flickers.

Doesn’t work either, since newImageRect doesn’t take position. I set the off-screen position after I create it, and it still flickers.

Any other ideas? This should be a simple thing to do.

Use spritesheet

Can you duplicate the problem only coding the image. Maybe the issue is with something else

Have you tried creating a new displaygroup outside of the screen area, and assigning it to that group as part of its creation (as far as I recall, most objects can take a parent argument). It might still create the object and then move it to the display group, causing the flicker though.

It should be simpler than that.

Can you post your code?

  • C