Euflorium: The Eufloria Community

Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: annikk.exe on January 03, 2011, 04:00:59 AM

Title: Controlling the fade-in at game start
Post by: annikk.exe on January 03, 2011, 04:00:59 AM
Hello,


When I start a level that uses a black backdrop colour, it takes a while for the colour to fade in - there's a sort of corona from the white menu screen that seems to disappear over the course of 20 seconds.  It normally happens very smoothly, I think, but the amount of code in the level is causing it to slow right down.

Is there any way to control this fade-in?  Or disable it completely?
Title: Re: Controlling the fade-in at game start
Post by: AWS on January 03, 2011, 04:04:24 AM
very good question.
ive wondered about this myself. its actually the very reason ive got rid of the colour-changing background in my as-yet-to-be-released map.
sometimes of course, its a very jerky transition and sometimes its not.. any reason for this change of behaviour, too?

anwers on a postcard...

Title: Re: Controlling the fade-in at game start
Post by: Alex on January 03, 2011, 05:19:09 AM
You can actually do this, I've just discovered. Pretty cool.
Code: [Select]
Game = luanet.import_type("Eufloria.Game") -- Import the game type to get access to the game instance and therefore the backdrop colour.
Colour=Game.Instance.BackdropColour -- Copy the existing backdrop colour - we're only doing this to get hold of a colour object we can change.
Colour.R = someRedValueBetweenZeroAndOne -- insert your own colour.
Colour.G = someGreenValueBetweenZeroAndOne
Colour.B = someBlueValueBetweenZeroAndOne
Game.Instance.BackdropColour = Colour -- re-assign the backdrop colour to your own value.
Game.Instance.TargetBackdropColour = Colour -- Set the target backdrop colour or the backdrop will fade right back to where it was. If you don't do this you'll get a flash of your desired colour - could also be useful.

Title: Re: Controlling the fade-in at game start
Post by: annikk.exe on January 03, 2011, 05:44:24 AM
You'll never fit all that on 1 postcard!  :P


Thanks for this Alex - that's freaking awesome.  Works a treat in my LevelSetup.  I wasn't really expecting such an easy resolution to this one!
Title: Re: Controlling the fade-in at game start
Post by: Alex on January 03, 2011, 05:47:49 AM
Actually the possibilities are wide with all this luanet business, see the new ui thread for an example.
Title: Re: Controlling the fade-in at game start
Post by: AWS on January 03, 2011, 07:37:44 AM
im liking it very much  ;D
thanks alex.