Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: my2k on Tue 12/04/2016 06:02:06

Title: gui button with image(a view) showing as half-transparent?
Post by: my2k on Tue 12/04/2016 06:02:06
So after pouring endlessly over the forum archives and the manuals for the game, I think I finally need to admit I need help. Thank you all in advance for at least taking a peek.

I'm using a simple GUI(Dispgui) to display a view, and then positioning it alongside dialogue. Inside the GUI is a button(btnProfileView) with the exact same size, positioned at 0,0 and when the dialogue is called, the proper "profile view" is assigned to the button, allowing for a simple portrait animation view to be shown alongside said dialogue.
my code is this for each line of dialogue(huge, I know, but oh well):
Code (ags) Select
Dispgui.Visible = true;
  Dispgui.SetPosition(550, 250);
  btnProfileView.Animate(4, 0, 10, eRepeat);
  cMadia.SayAt(50, 550, 700, "omg will this work?! I hope it does!!");
  Dispgui.Visible = false;


Though it animates fine and works well every other way and looked lovely, when it is displayed it has this strange property of being semi-transparent with this strange half-tone pattern! What the:

(http://i.imgur.com/PkNIek8.gif)

I've checked the properties for the GUI and the button inside it and they seem to be right:

(http://i.imgur.com/LFn9Uerl.gif) (http://i.imgur.com/Uo73n70l.gif)

can you see what it is that might be wrong? Thank you so, so much in advance :)
Title: Re: gui button with image(a view) showing as half-transparent?
Post by: Gurok on Tue 12/04/2016 06:22:55
In Visual section of General Settings, there's a setting called "When player interface is disabled, GUIs should". Try setting that to "Display normally". The default, "Grey out all their controls" results in that halftone pattern you're seeing.

(http://i.imgur.com/VoT2ocx.png)

Using a button for graphics is standard practice, however, it's often reserved for more advanced portrait displays. A simpler way to display a portrait when a character speaks is to set "Speech style" to "SierraWithBackground" or "SierraTransparent" under General Settings, then assign a SpeechView to that character (in the character properties).
Title: Re: gui button with image(a view) showing as half-transparent?
Post by: my2k on Tue 12/04/2016 06:29:35
...my god, I can't believe it was that easy. Thank you very much, it worked great. Hopefully if anyone in the future has this issue they can search and find this thread :)
Title: Re: gui button with image(a view) showing as half-transparent?
Post by: Khris on Tue 12/04/2016 13:57:23
Just a heads up regarding your custom speech code:

// add to GlobalScript.ash
import function Speak(this Character*, String text);

// add to top of GlobalScript.asc
function Speak(this Character*, String text) {
  Dispgui.Visible = true;
  Dispgui.SetPosition(550, 250);
  btnProfileView.Animate(4, this.ID, 10, eRepeat);
  this.SayAt(50, 550, 700, text);
  Dispgui.Visible = false;
}


Now you can simply call
  cMadia.Speak("omg will this work?! I hope it does!!");
and all your custom code will run.

Note that the function expects a loop for each speaking character in view 4, where the loop number is the same as the character's ID.