Thread: Screen Fading
View Single Post
  #9  
Old 04-21-2013, 11:06 PM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by Crow View Post
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.

Last edited by Draenin; 04-21-2013 at 11:21 PM..
Reply With Quote