Setting initial actor opacity

nev

  • *
  • Posts: 386
I know this has been already suggested in the past. But I would like to renew the request.
It is a bit intricate to fade-in an actor from nothing, because as it is created it is always with opacity 100%. So you have to create it off-screen, fade it out, then move it to its final position and then fade it in.  :o
What about putting in the actor property pages (in appearance, for example) an option called "initial opacity"?

saulochina

  • Posts: 214
or instead you can create it invisible and after set the opacity and make it visible. i still think that your request is valid, but is easier than move the actor and the other workarounds.
Finding the fun!
Squib Wars. Now complete, and avaible for free on App Store! http://bit.ly/LxJ62L
https://www.facebook.com/twoheadedgames
Twitter: @saulochina
MSN: sauloj.china@hotmail.com

rob1221

  • *
  • Posts: 9474
You don't need to create the actor off screen.  Just hide the sprite when created, fade out, show sprite, then fade in.

nev

  • *
  • Posts: 386
I'm not sure, but as far as I remember, this procedure was generating a brief initial flashing of the actor image. Besides, you must admit this is a bit "intricate".
What prevents the team to give the possibility to set the initial opacity of the actor in the appearance page? like it is present since the beginning in other similar middlewares like Gamesalad, for example?

rob1221

  • *
  • Posts: 9474
After looking through the API and testing it looks like setting the opacity to 0 is as simple as this:
Code: [Select]
actor.alpha = 0;

nev

  • *
  • Posts: 386
But this has to be used in the "on creating" block in any case: wouldn't the actor flash for a moment?

rob1221

  • *
  • Posts: 9474
There was no flash when I tested it.

FortySe7en

  • Posts: 304
I keep fading characters in and never had them flash.
I just do:
'create actor X'
fade out over 0 seconds
fade in over 1 second

There you go, created actor will fade over 1 second. They never 'blink' for me when I use that.

captaincomic

  • *
  • Posts: 6108
There are now blocks to get/set the actor opacity. If you put them in "when created" the actors won't blink for sure.