ID:1894697
 
im looking on how to flashing a mob between two colours with animate() how can i do that? maybe this will help me to get it more

What do you mean flashing?

Explain the effect you want.
In response to Ter13
some one is being electricuted. Id prefer black and white. But between black and the regular icons state might be good enough
In response to Ter13
i just dont want to draw black and white icons for every single enemy
Unfortunately, you can't flash the icon white. Color is multiplicative, so you can't make them appear white through multiplication. Division would work this way, unfortunately division isn't supported for blend modes.

animate(ref,color=rgb(0,0,0),time=TICK_LAG,loop=-1)
animate(color=rgb(255,255,255),time=TICK_LAG)


TICK_LAG should be the amount of time for one frame.
If you want the flash to last more than one frame:

animate(ref,color=rgb(0,0,0),time=0,loop=-1)
animate(time=TICK_LAG*4)
animate(color=rgb(255,255,255),time=0)
animate(time=TICK_LAG*4)


This will flash each color for 4 frames.

You can also change the loop to a specifc number rather than permanent, or you can stop it:

animate(ref,color=rgb(255,255,255),time=0)
In response to Ter13
yea i thought the white wouldnt work.


animate still really confuses me. Why for the second the final line is the time outside of the condition thats animating the colour?

than there is this

animate(m,color=rgb(0,0,0),time=1,loop=8)
animate(color=rgb(255,255,255),time=1)


the first 1 is looping but why than does the second 1 loop or appear to loop when you havent set loop to equal anything
The looping is for the entire animation. You really only need to set the first step to loop. Every other step doesn't need to specify the number of times it will play.

The time refers to the time for the step.

animate still really confuses me. Why for the second the final line is the time outside of the condition thats animating the colour?

That's because you don't want the color to fade from white to black, you want it to flash white and black. Animation generates smooth transitions over a period of time.

What I showed you changes the colors instantly, but doesn't fade the colors smoothly. It's instant.
In response to Ter13
well it did help me out, not perfectly to understand animate. but i think i understand it a bit more. Thank you :)
I'm seriously considering an expansion to atom.color in 509 that would allow for a color matrix effect. DirectX and OpenGL already support such a thing, as does the webclient's color handling, and software mode would be a breeze.
That'd actually be pretty awesome. I can already picture how I'd use parts of this.
In response to Lummox JR
So I could decrease the colour finally? I'd love that!