Black Screen with text

Started by Ginger_till_i_dye, Mon 23/03/2020 13:07:21

Previous topic - Next topic

Ginger_till_i_dye

Hello - I'm having trouble on getting an effect I want - Any tips or directions would be useful

I am trying to have the player click on a hotspot, have the screen fade to black, display a message, fade back in to the same screen
I tried:

function hHotspot1_Interact()
{
FadeOut(4);
Display("Message");
FadeIn(4);
}

but this doesn't display the message (assumedly because of the Faded out screen)
Tinting the screen doesn't go dark enough :/

Please and Thank You

Slasher

#1
Could try a black gui with a label. set transparency to 100 and then make visible and fade in and out with tween transparency... and clickable set to false.

Example:

In this instance make a gui named gBlack screen sized, set clickable to false and its transrancy to 100.

Code: ags

gBlack.Transparency=100;
gBlack.Visible=true;
gBlack.TweenTransparency(1.3, 0, eEaseInEaseOutTween, eBlockTween); // Tween Module
Display("You manage to find a space in the tent where snow hasn't laden.");    // I use Display and not label in this case
gBlack.TweenTransparency(1.3, 100, eEaseInEaseOutTween, eBlockTween);  // Tween Module
gBlack.Visible=false;



ManicMatt

#2
If you're not comfortable with using a GUI, you can make an object sprite that's just pure black the same size as the screen and have that change transparency. The baseline would need to be in front of everything else though, and it would need to be set to visible = false initially.

Alternatively, just have it change rooms if you have fade transitions between rooms and just have a black room.

Slasher: Doesn't tween code require the Tween module?

Slasher

#3
If its for one room then an object may be better as Matt described.. though watch it's Baseline...

The Tween Module is a 'must have' for practically all games...

TheManInBoots

#4
Instead of using tween, you can simply create the fade in/out of the gui or object, by looping the objects/guis transparency up/down with a 'while' function.
e.g.

Code: ags

while(gBlackGui.Transparency>0)
{
gBlackGui.Transparency=gBlackGui.Transparency-4;
Wait(1);
}


This makes the black gui that was initially set to 100% Transparency fade in.

ManicMatt

#5
Quote from: Slasher on Mon 23/03/2020 13:56:06
The Tween Module is a 'must have' for practically all games...

Unless you know something I don't, I wouldn't assume they have Tween installed. Especially if they need help with making a black screen, I think tweening is too advanced for them as it's very code intensive and wouldn't recommend it to anyone starting out or not very good with coding, like myself! Haha.

Slasher

#6
I find the Tween module very useful and once you have it you just need one line of code to run basically...

Its a tool to make life easier.. If you have a car you should have some tools to fix it, or would you try to fix it with other stuff?

Beginners should be made aware of tools available and do their own research..

I think there was talk at one time to include certain modules/plugins in the AGS folder.. Or even within a custom Template..

TheManInBoots

#7
Quote from: ManicMatt on Mon 23/03/2020 15:36:33
Quote from: Slasher on Mon 23/03/2020 13:56:06
The Tween Module is a 'must have' for practically all games...

Unless you know something I don't, I wouldn't assume they have Tween installed. Especially if they need help with making a black screen, I think tweening is too advanced for them as it's very code intensive and wouldn't recommend it to anyone starting out or not very good with coding, like myself! Haha.
I'm really glad that there are some people with a healthy common sense.
That's very valuable advice you give ManicMatt: Be aware on what level of knowledge people are on, to best help them!

ManicMatt

Thanks. If the tweening code was too confusing for me - someone who has made 4 full AGS games, - Well, you get the picture.

TheManInBoots

#9
Yeah I get it.

I've seen you have three of your games listed on this web site.
I'm gonna check them out when I get to it.

ManicMatt

Whoops! I forgot to make a game entry for my latest game, I'm glad you said 3 games haha!

SMF spam blocked by CleanTalk