SOLVED: Trouble with creating Thought bubble Text Window GUI

Started by baggyg, Fri 29/06/2012 13:52:13

Previous topic - Next topic

baggyg

Hi,

Firstly thanks for any help with this. Just started first game and finding everything very achievable. However I am having problems with creating my own thought bubble. I have created TextWindowGui and set it to be the selected one in general settings. I can achieve this so it is a rounded unbroken box, however I am struggling to add the circles at the bottom (pointing to the characters head). If I use the EDGE 7 (bottom of the box) this gets repeated 2 or 3 times and I also cannot position it right.

Does anyone have a good example of one they have done or alternatively a good tutorial.

Thanks in advance.

Baggy

Khris

There's no automatic way of doing this, you have to add the circles yourself. Since the speech GUI is positioned in relation to the character's feet, you should be able to use Character.x/y.
Code: ags
void MyThink(this Character*, String message) {
  gCircles.SetPosition(character.x - 30, character.y - 80);
  gCircles.Visible = true;
  this.Think(message);
  gCircles.Visible = false;
}


My guess is you saw this in Resonance. It uses a lot of stuff that took some coding magic to implement.

Snarky

Resonance has a bunch of stuff in it that boggles the mind that it's possible in AGS. Coding magic indeed!

baggyg

Thanks yeah Resonance amongst others (non AGS). Thats great. A lot of the learning curve for me has been to know when I should branch out into my own code or what I achieve through the GUI (I.e. over hotspots etc). Thanks for very prompt response. I will post how I get it working.

baggyg

Got it working pretty much how you said. 2 issues with this is that the thought window always takes Z-Index priority even though the "bubbles" have a higher number. The second issue is that I cannot seem to move the main text window (imagine this is automatically placed). Is there some way to control the text window position or alternatively the command for manually calling a text window GUI (with text)?

baggyg

In the end gave up trying to write around the Text Window GUI and wrote my own MyThink function. Used a standard GUI and then dynamically sized elements on it depending on length of message. GUI is background image / Button that expands to text / Bottom button (representing bottom of thought bubble). Still need to figure out positioning when too close to edges of screen but can design arounf that (who wants to go near the edge of the screen anyway?! :-))

Result with placeholder graphics
[imgzoom]http://www.i-represent.co.uk/bubble.jpg[/imgzoom]

Khris

Nice one!
Yeah, I'd probably code it from scratch, too. The bottom corners seem to be stretched, btw.

baggyg

Thanks, still fiddling around making sure I can get the rest of the things working such as Think animation. May expand it sometime to not be fixed width but this is good enough for me. The corners aren't stretched its just the graphic is rough; just a placeholder at the moment. Its good when you have control as can customise a lot more. Added a bit so that the time shown on screen is relative to length of message etc.

SMF spam blocked by CleanTalk