Author Topic: Controlling the fade-in at game start  (Read 4592 times)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Controlling the fade-in at game start
« 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?

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Controlling the fade-in at game start
« Reply #1 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...


Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Controlling the fade-in at game start
« Reply #2 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.


annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Controlling the fade-in at game start
« Reply #3 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!

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Controlling the fade-in at game start
« Reply #4 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.

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Controlling the fade-in at game start
« Reply #5 on: January 03, 2011, 07:37:44 AM »
im liking it very much  ;D
thanks alex.