Change web-gl effect?

Get help using Construct 2

Post » Thu Feb 27, 2014 12:19 am

Can anyone give me a code to change a web-gl effect every x second.

Example : Add blur effect to layout, and want to make the effect change all the time.

On start of layout ---- ( Layout blur make it move between 1 to 9 ).

Any help will be great
Thank's
B
7
S
1
Posts: 65
Reputation: 586

Post » Thu Feb 27, 2014 2:13 am

@slanw

There's probably a few ways to go about this, most likely some better ones from more experienced guys around here but this method works for me and doesn't require to many events..

Firstly..

Pick a Sprite on screen preferably on the layer you want to effect (just create a blank square and set invisble if you like) and add to it the "Sine Behavior".

In the Sine Properties set Movement to "value only"
Set everything to 0 cept' for Magnitude (100) and Period (say 2?)

* you can play around with Magnitude and period for desired result..

In events:

Everytick > System-Set layer Effects Parameter > The layer, The effect, Index (0), then > "Sprite.Sine.Value"

*replace 'sprite' .sine.value with your sprites name that you added sine to

* You'll probably need to do this for Both Horizontal and Vertical but they can both run from the same Sine.Value.

Hope that works okay for you..
B
9
S
2
Posts: 26
Reputation: 586

Post » Thu Feb 27, 2014 8:54 pm

@Ometheu

Thank's alot
This is a smart trick and no need for many event's

I'm searching for a way to make light and dark effect like " our darker purpose ' Game

The game was made by construct 2,

If you know how to make the same light effect, this will help me alot

Thank's again
B
7
S
1
Posts: 65
Reputation: 586

Post » Fri Feb 28, 2014 12:46 pm

Here's a simple demonstration of one way I go about the lighting effect, this isn't lightweight, so just use how I have the layers blending in principal to apply to your own needs, I suggest you play around with layer 2's effect, hardlight, multiply etc will yield different results.

Basically I have one layer on top of everything with a solid black background color (helps hides the edges of my sprite image), I set the layers effect to overlay, then I create a sprite on there with my light source image, generally a white circle with a fading to transparent radius. Lastly I change the sprites Blendmode to Additive.

Plus search around the forum, There's probably a smarter, better and more performance friendly method out there

** Edit: Forgot to mention, use your arrow keys to move the light around on the attached example.
You do not have the required permissions to view the files attached to this post.
B
9
S
2
Posts: 26
Reputation: 586

Post » Sun Mar 02, 2014 11:57 am

Sorry for the late replay
This is awesome light effect Ometheu

I will mix it with the sine method to get best result.
B
7
S
1
Posts: 65
Reputation: 586


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests