gui button with image(a view) showing as half-transparent?

Started by my2k, Tue 12/04/2016 06:02:06

Previous topic - Next topic

my2k

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
 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:



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 :)

Gurok

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).
[img]http://7d4iqnx.gif;rWRLUuw.gi

my2k

...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

Just a heads up regarding your custom speech code:

Code: ags
// 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
Code: ags
  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.

SMF spam blocked by CleanTalk