Author Topic: MODULE: SpeechBubble v0.8.0  (Read 5035 times)

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: MODULE: SpeechBubble v0.8.0
« Reply #40 on: 23 Feb 2018, 06:44 »
All development of this module is on hold while I'm working on the AGS Awards Ceremony client.

To do text in multiple colors you have to break it up into separate strings that you render individually (using DrawingSurface.DrawString()), with the appropriate x and y offsets. There's an outline of how you might do it here.

To see how you're meant to be changing the tail, check out this post. Unfortunately there's a bug in the module which means you have to edit the internal initSpeechBubble() function instead, as shown in the post above.

The tail flipping depending on character angle is a feature I've been meaning to add, but it's not implemented. Basically, in renderBubble32() there are two calls to drawPixelArray(). The last two arguments are whether to flip the array horizontally or vertically, and both are set to false. If you set the second-to-last to true in both calls, it will flip it. So I would add a bool argument to renderBubble32(), and pass that along to drawPixelArray(). Then in the calls to renderBubble32() in realSayAtBubble(), SayBubble() and SayBackgroundBubble() you would set the argument depending on which way the character is facing.

Narehop

  • Solodev on @Outline_team
Re: MODULE: SpeechBubble v0.8.0
« Reply #41 on: 07 Mar 2018, 19:04 »
How i can to set a custom background?

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: MODULE: SpeechBubble v0.8.0
« Reply #42 on: 08 Mar 2018, 21:45 »
You can set a background color with SpeechBubble.BackgroundColor. You cannot set a background graphic.

Narehop

  • Solodev on @Outline_team
Re: MODULE: SpeechBubble v0.8.0
« Reply #43 on: 01 Apr 2018, 19:07 »
You can set a background color with SpeechBubble.BackgroundColor. You cannot set a background graphic.

you'll be update with this option?

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: MODULE: SpeechBubble v0.8.0
« Reply #44 on: 01 Apr 2018, 22:58 »
Sure, when I find time to work on it. I think TotalLipSync is first in line for an update, though.

bx83

  • Get 'Er Doooooone
MODULE: SpeechBubble v0.8.0
« Reply #45 on: 27 Jun 2018, 08:13 »
Snarky, can you give us an ETA on 'ThinkBubble' function?
I would guess you just run speechbubble, but with 1 parameter change: to display the 3 bubbles going to the rounded corner box, instead of the angled-line going from the round corner box.
« Last Edit: 27 Jun 2018, 08:57 by Snarky »

bx83

  • Get 'Er Doooooone
MODULE: SpeechBubble v0.8.0
« Reply #46 on: 27 Jun 2018, 08:26 »
Too late, I wrote some shitty poorly tested code! :P

This is the same code as SayBubble, but with one parameter change (from true to false) on line 10:
Code: Adventure Game Studio
  1. void ThinkBubble(this Character*, String message, GUI* bubbleGui)
  2. {
  3.   if(message == null) return;
  4.   if(!game.bgspeech_stay_on_display)
  5.     _stopAllBackgroundBubbles();
  6.   if((Speech.VoiceMode == eSpeechVoiceOnly && hasVoiceClip(message)) || message == "...")
  7.     this.SB_sayImpl(message);
  8.   else
  9.   {
  10.     DynamicSprite* bubbleSprite = this.renderBubble32(message, false);  //<--- SETTING THIS TO FALSE WAS ALL I HAD TO DO
  11.     // Position bubble over character head
  12.     int x = this.x - GetViewportX() - bubbleSprite.Width/2;
  13.     x = _clampInt(x, 0, System.ViewportWidth - bubbleSprite.Width);
  14.     int y = this.y - GetViewportY() - bubbleSprite.Height - this.GetHeight() - (_heightOverHead - _talkTailHeight + 1);
  15.     y = _clampInt(y, 0, System.ViewportHeight - bubbleSprite.Height);
  16.  
  17.     this.realSayAtBubble(x, y, message, bubbleGui, bubbleSprite);
  18.   }    
  19. }
« Last Edit: 27 Jun 2018, 08:57 by Snarky »

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: MODULE: SpeechBubble v0.8.0
« Reply #47 on: 27 Jun 2018, 09:20 »
Snarky, can you give us an ETA on 'ThinkBubble' function?

Well, it's part of the API I outlined when you contracted me to develop this module, so if you really need it I will make it a priority.

I would guess you just run speechbubble, but with 1 parameter change: to display the 3 bubbles going to the rounded corner box, instead of the angled-line going from the round corner box.

There's a little bit more to it than that if it's to work fully like AGS's Character.Think(), but a simple version shouldn't be too hard.

The main work is to complete and test the 8.9 rewrite, since I don't want to maintain two entirely separate branches going forward.

bx83

  • Get 'Er Doooooone
Re: MODULE: SpeechBubble v0.8.0
« Reply #48 on: 27 Jun 2018, 11:20 »
My code works, but perhaps not in all situations.
All good, I'm happy with it so far, take your time :)

Ray

  • Alien from planet Earth
Re: MODULE: SpeechBubble v0.8.0
« Reply #49 on: 24 Jul 2018, 00:01 »
Thank you very much! Definitely will see to use this module in my game :)