Page 1 of 1

Fade in Fade out

Posted: Wed Mar 03, 2021 10:49 am
by Eleven Warrior
I was wondering if anyone knows how i can fade out to black then after say 5 seconds it fades back to the game eg: Quest is completed i want it to fade in to black screen the after 5 second the fade in (back to the game)

Re: Fade in Fade out

Posted: Wed Mar 03, 2021 11:20 am
by THOM
use
GameMode.fadeIn(color, length)
GameMode.fadeOut(color, length)

e.g.

Code: Select all

function fade()
	GameMode.fadeOut(0,1)
	delayedCall(self.go.id, 5, "fadeBack")
end

function fadeBack()
	GameMode.fadeIn(0,1)
end
You might want to think about disabeling the champions during the five seconds of black?
Then use GameMode.setEnableControls(false) - and of course set it back to true afterwards.

Re: Fade in Fade out

Posted: Wed Mar 03, 2021 11:31 am
by Eleven Warrior
Thom it comes up with the error: attempt to index field 'go' (a functionvalue)

Re: Fade in Fade out

Posted: Wed Mar 03, 2021 1:47 pm
by THOM
Are you using the code in a script-entity or elsewhere?

EDIT: Ah, and the name of the function has to be set in quotes. Corrected my code above.

Re: Fade in Fade out

Posted: Fri Mar 05, 2021 11:56 pm
by Eleven Warrior
Thanks for the help mate :)