Adding effects to Sprite

For developers using the Construct 2 Javascript SDK

Post » Wed Jan 07, 2015 8:25 pm

Hello, everyone.

Is there any way to add effect to sprite object from my behavior?

I'm trying to create interactive objects, which are highlighted when the player ovelaps it. So I'm writing a behavior to Sprite, it already can wait for overlapping with player sprite and show some text over object when it happens. But now I want to replace text (it's too obstructive on the screen) with effect, laying on object sprite.

Is there any way to add effect (brightness, for example) from my code? Or maybe there is any other way to solve my problem?

PS Sorry for my English, it's not my native language.
B
3
Posts: 2
Reputation: 181

Post » Wed Jan 07, 2015 11:03 pm

Hi here is one way of doing it, I would add a "Family" for example "Enemies" or "Items" and then add the effect to that family, because you don't have to write repetitive code like the one in my example. But I wanted to support the free version of construct 2 as well so my example contains some repetitive code.
You do not have the required permissions to view the files attached to this post.
B
39
S
9
G
4
Posts: 163
Reputation: 6,516

Post » Thu Jan 08, 2015 9:13 pm

OneMuppet wrote:Hi here is one way of doing it, I would add a "Family" for example "Enemies" or "Items" and then add the effect to that family, because you don't have to write repetitive code like the one in my example. But I wanted to support the free version of construct 2 as well so my example contains some repetitive code.


I looked at your example, and this is not exactly what I want to do. Yes, your example doing that thing, but I need to do the same from my own behavior, which I write by myself using JavaScript. I'm looking for any functions in JavaScript code, which can help me to apply effect to any sprite I want.

Anyway, thanks for your answer!
B
3
Posts: 2
Reputation: 181


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest