Randomly Tint Sprites

Get help using Construct 2

Post » Thu Aug 30, 2012 11:16 am

Hi there,

I'm playing around with some of the new FX in R100/101.

Now my question: How can i randomly tint my Sprites (or parts of it)

Here is a little Eample (*.capx) for a better Understanding what i mean:

Example

Hope you can help me out!

Thanks

KMag
B
13
S
4
G
3
Posts: 120
Reputation: 3,456

Post » Thu Aug 30, 2012 11:24 am

I'm not sure if I understood your question, but I try..
You can add some different colored block as animation frames of your "Blue" object.
Then, editing the animation, you must set speed = 0.
Now you have an animation in "freeze" state on the frame 0 (the first).
To randomize the tint, you can use floor(random(numeberOfColours)) to set the frame of your object.
B
21
S
5
G
5
Posts: 16
Reputation: 5,421

Post » Thu Aug 30, 2012 11:52 am

@HatsuSakura

hmm...what i mean is - when i click Left and Hold - only the new generated sprites should be new colored....

KMag
B
13
S
4
G
3
Posts: 120
Reputation: 3,456

Post » Thu Aug 30, 2012 1:05 pm

I'm sorry: I completely misunderstood your question..

I tried this workaround (but it doesn't solve anything): I set to a random value an instance variable called "B" for the Blue object. Then I assigned the B value for the tint FX but while the B variable value was different for each Blue object, the tint was always the same.

I think the reason is because Tint is specific for the object itself (read "global"). So even if an instance variable could be different for every Object, an effect defined as an FX of the Object can be only global..

I hope you can solve this issue.
let me know, because I'm interesting in this argument (now I manage colors with the frozen animation workaround...)HatsuSakura2012-08-30 13:07:13
B
21
S
5
G
5
Posts: 16
Reputation: 5,421


Return to How do I....?

Who is online

Users browsing this forum: fredriksthlm, MPPlantOfficial and 22 guests