Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Screen Fading (https://forums.graalonline.com/forums/showthread.php?t=134268121)

brokk 04-20-2013 06:44 PM

Screen Fading
 
1 Attachment(s)
Hello all,

My goal is to fade the sides of the screen from black, coming in more and more transparent.

One way of doing it is I made fading images and they were set on a showImg and always staying on borders of screen, adjusting it's height and width according to screen size.

Unfortunately, I think it somewhat lags.

Any suggestions?

I attached a picture with the idea I had in mind.
The black starts from the borders, and fades in.

Crow 04-20-2013 07:21 PM

Images are the way to go~

brokk 04-20-2013 07:32 PM

Quote:

Originally Posted by Crow (Post 1716693)
Images are the way to go~

Hmmm, I see. Well, I am also trying to get kind of a motion blur going on.

Any ideas for that?

Crow 04-20-2013 11:17 PM

Quote:

Originally Posted by brokk (Post 1716694)
Hmmm, I see. Well, I am also trying to get kind of a motion blur going on.

Any ideas for that?

Try:
PHP Code:

level.tilelayers[0].alpha 0.9

Less for a stronger effect. Should be the correct var, not 100% sure though.

devilsknite1 04-21-2013 03:48 AM

Could always create a circular polygon around the player according to screenwidth/height
Actually, you may be interested in looking at this thread. It's not exactly what you're looking for, but can be done similarly.

And what kind of blur are you looking for? The level and the player?

brokk 04-21-2013 02:15 PM

Quote:

Originally Posted by devilsknite1 (Post 1716709)
Could always create a circular polygon around the player according to screenwidth/height
Actually, you may be interested in looking at this thread. It's not exactly what you're looking for, but can be done similarly.

And what kind of blur are you looking for? The level and the player?

Looking for a a slight blur, but then a motion blur for when a player hits a certain speed.

Stephen 04-21-2013 06:47 PM

Quote:

Originally Posted by brokk (Post 1716718)
Looking for a a slight blur, but then a motion blur for when a player hits a certain speed.

Yea, Tig and I did this on GK for our Easter monster attacks. We had to use images - the results were nice and I'd love to see this level of detail more common place.

xXziroXx 04-21-2013 07:44 PM

Quote:

Originally Posted by Stephen (Post 1716737)
Yea, Tig and I did this on GK for our Easter monster attacks. We had to use images - the results were nice and I'd love to see this level of detail more common place.

Would be nice if the code for it could be shared.

Draenin 04-21-2013 11:06 PM

Quote:

Originally Posted by Crow (Post 1716701)
Try:
PHP Code:

level.tilelayers[0].alpha 0.9

Less for a stronger effect. Should be the correct var, not 100% sure though.

You'll want to reserve tile layer commands for tileset palette changes, not visual transitions. Seteffect would be more appropriate to use for this kind of thing because it darkens the screen, not the tiles.



I would recommend using a gradient image overlay on the screen layer, similar to what you've got pictured. By overlay, I mean that you need to stretch the image to the dimensions of the player's screen, and make it transparent. It shouldn't lag much at all as long as you aren't constantly re-drawing the image when you don't need to or anything like that.

Then for the actual transition itself, create a function using seteffect to fade the screen in and out as the player is warping from one level to another.

By combining a gradient image overlay with a fader, the darker shades of the gradient will fade out first, and the lighter shades will fade out last. However, you might also want to experiment by either inverting the image as well, or changing the image mode to negative as well to produce different results. If you wanted to get really fancy, you could try overlays in different shapes or forms.

Crow 04-21-2013 11:18 PM

Quote:

Originally Posted by Draenin (Post 1716747)
You'll want to reserve tile layer commands for tileset palette changes, not visual transitions. Seteffect would be more appropriate to use for this kind of thing because it darkens the screen, not the tiles.

He did say motion blur. Setting the bottom tile layer's alpha below 1 will create a motion blur-ish effect. You can't achieve that with anything else.

Draenin 04-21-2013 11:30 PM

Quote:

Originally Posted by Crow (Post 1716748)
He did say motion blur. Setting the bottom tile layer's alpha below 1 will create a motion blur-ish effect. You can't achieve that with anything else.

Great news. You can actually combine all three effects. (Overlay, Fade, Motion Blur) :D

However, I would not strongly recommend keeping motion blur on all the time. I've gotten a few complaints that way. You have to use it judiciously.

brokk 04-22-2013 12:01 AM

Quote:

Originally Posted by Draenin (Post 1716751)
Great news. You can actually combine all three effects. (Overlay, Fade, Motion Blur) :D

However, I would not strongly recommend keeping motion blur on all the time. I've gotten a few complaints that way. You have to use it judiciously.

The plan was when the player "sprints", the motion blur is activated. So I'll just have the client check for speeds and movement and such.

Haven't tried the script that you guys offered me yet, but I will tonight and let you guys know how it goes. perhaps screenies if I'm having problems.

DustyPorViva 04-22-2013 12:49 AM

1 Attachment(s)
You can just create a gani that creates a trail effect of the player and set it to an attr.

I think I actually have mine from Testbed. Basically you run a loop(however long you want the trail to be) and have an array that keeps track of the last 20 or so(again, the length of the trail) positions of the player. My version goes a bit further and also stores the animation frame to maintain accuracy and effect.

brokk 04-22-2013 12:59 AM

Quote:

Originally Posted by DustyPorViva (Post 1716763)
You can just create a gani that creates a trail effect of the player and set it to an attr.

I think I actually have mine from Testbed. Basically you run a loop(however long you want the trail to be) and have an array that keeps track of the last 20 or so(again, the length of the trail) positions of the player. My version goes a bit further and also stores the animation frame to maintain accuracy and effect.

This is sweet, but I mean a full screen blur.

DustyPorViva 04-22-2013 01:05 AM

Quote:

Originally Posted by brokk (Post 1716765)
This is sweet, but I mean a full screen blur.

Then what Crow said is the only option. You just need to tweak the value to determine the strength of it.


All times are GMT +2. The time now is 08:11 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.