Jibble

Author Topic: gui button with image(a view) showing as half-transparent?  (Read 729 times)

my2k

  • Posts: 16
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: Adventure Game Studio
  1.  Dispgui.Visible = true;
  2.   Dispgui.SetPosition(550, 250);
  3.   btnProfileView.Animate(4, 0, 10, eRepeat);
  4.   cMadia.SayAt(50, 550, 700, "omg will this work?! I hope it does!!");
  5.   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:



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



can you see what it is that might be wrong? Thank you so, so much in advance :)
« Last Edit: 12 Apr 2016, 06:29 by my2k »

Gurok

  • Rottwheelers
  • Posts: 1,793
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    • I can help with proof reading
    • I can help with scripting
    • Gurok worked on a game that won an AGS Award!
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
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.



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).
« Last Edit: 12 Apr 2016, 06:31 by Gurok »

my2k

  • Posts: 16
...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 :)

Khris

  • Posts: 10,676
  • having to deal with what games are going through
    • Lifetime Achievement Award Winner
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Khris worked on a game that was nominated for an AGS Award!
Just a heads up regarding your custom speech code:

Code: Adventure Game Studio
  1. // add to GlobalScript.ash
  2. import function Speak(this Character*, String text);
  3.  
  4. // add to top of GlobalScript.asc
  5. function Speak(this Character*, String text) {
  6.   Dispgui.Visible = true;
  7.   Dispgui.SetPosition(550, 250);
  8.   btnProfileView.Animate(4, this.ID, 10, eRepeat);
  9.   this.SayAt(50, 550, 700, text);
  10.   Dispgui.Visible = false;
  11. }

Now you can simply call
Code: Adventure Game Studio
  1.   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.