Jibble

Author Topic: Black Screen with text  (Read 167 times)

Black Screen with text
« on: 23 Mar 2020, 13:07 »
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

  • slasher
    • I can help with AGS tutoring
    • Lifetime Achievement Award Winner
    • I can help with scripting
    • I can help with story design
    • Slasher worked on one or more games that won an AGS Award!
    •  
    • Slasher worked on one or more games that was nominated for an AGS Award!
Re: Black Screen with text
« Reply #1 on: 23 Mar 2020, 13:10 »
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: Adventure Game Studio
  1. gBlack.Transparency=100;
  2. gBlack.Visible=true;
  3. gBlack.TweenTransparency(1.3, 0, eEaseInEaseOutTween, eBlockTween); // Tween Module
  4. Display("You manage to find a space in the tent where snow hasn't laden.");    // I use Display and not label in this case
  5. gBlack.TweenTransparency(1.3, 100, eEaseInEaseOutTween, eBlockTween);  // Tween Module
  6. gBlack.Visible=false;
  7.  

« Last Edit: 23 Mar 2020, 13:42 by Slasher »

Re: Black Screen with text
« Reply #2 on: 23 Mar 2020, 13:47 »
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?
« Last Edit: 23 Mar 2020, 13:51 by ManicMatt »

Slasher

  • slasher
    • I can help with AGS tutoring
    • Lifetime Achievement Award Winner
    • I can help with scripting
    • I can help with story design
    • Slasher worked on one or more games that won an AGS Award!
    •  
    • Slasher worked on one or more games that was nominated for an AGS Award!
Re: Black Screen with text
« Reply #3 on: 23 Mar 2020, 13:56 »
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...
« Last Edit: 23 Mar 2020, 13:59 by Slasher »

TheManInBoots

  • Epically wrote function to declare an int
Re: Black Screen with text
« Reply #4 on: 23 Mar 2020, 15:10 »
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: Adventure Game Studio
  1. while(gBlackGui.Transparency>0)
  2. {
  3. gBlackGui.Transparency=gBlackGui.Transparency-4;
  4. Wait(1);
  5. }
  6.  

This makes the black gui that was initially set to 100% Transparency fade in.
« Last Edit: 27 Mar 2020, 22:27 by TheManInBoots »

Re: Black Screen with text
« Reply #5 on: 23 Mar 2020, 15:36 »
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.
« Last Edit: 23 Mar 2020, 15:39 by ManicMatt »

Slasher

  • slasher
    • I can help with AGS tutoring
    • Lifetime Achievement Award Winner
    • I can help with scripting
    • I can help with story design
    • Slasher worked on one or more games that won an AGS Award!
    •  
    • Slasher worked on one or more games that was nominated for an AGS Award!
Re: Black Screen with text
« Reply #6 on: 23 Mar 2020, 15:57 »
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..
« Last Edit: 23 Mar 2020, 16:04 by Slasher »

TheManInBoots

  • Epically wrote function to declare an int
Re: Black Screen with text
« Reply #7 on: 24 Mar 2020, 17:40 »
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!
« Last Edit: 24 Mar 2020, 17:55 by TheManInBoots »

Re: Black Screen with text
« Reply #8 on: 24 Mar 2020, 20:20 »
Thanks. If the tweening code was too confusing for me - someone who has made 4 full AGS games, - Well, you get the picture.