[SOLVED] Dialog problem: Speech background overlapping portrait picture

Started by Kykke, Thu 05/05/2016 18:11:42

Previous topic - Next topic

Kykke

I'm creating a dialog view and trying to put the first speaker to the top-left corner and second speaker to bottom-right. I've chosen Speech style 'SierraWithBackground' and Sierra-style portrait location 'Alternate'.

Then running script from dialog:
Code: ags

cOne.SayAt(10,10,280, "The message I'd like to say");
cTwo.SayAt(10,110,280, "The message I'd like to say");


The cOne dialog looks just fine but for some reason the cTwo's Sierra-style background overlaps the portrait picture:

cOne: left.png
cTwo: right.png

Any idea what might cause this?
I'm using AGS 3.3.4. Tried also 3.4.0.6 but with same results.

Crimson Wizard

With "SayAt" function you directly control the speech text position (X,Y and Width). So it overlaps probably because the width is too big. Try reducing width (third parameter), or just using "Say" function that is supposed to handle text position automatically.

Kykke

Quote from: Crimson Wizard on Thu 05/05/2016 18:16:53
With "SayAt" function you directly control the speech text position (X,Y and Width). So it overlaps probably because the width is too big. Try reducing width (third parameter), or just using "Say" function that is supposed to handle text position automatically.

The lack of space was also my initial thought but It's not that. If I change the width like this:
Code: ags
cTwo.SayAt(10,110,180, "The message I'd like to say");

It changes the width of the text box but the overlapping problem still exists: right2

Crimson Wizard

I see.
I was able to reproduce same problem in old version too (3.2.1). This looks like a bug in AGS (portrait is not aligned properly).


If I understand you correctly, you want to modify where portraits are located. I then suggest trying to use "Say" command with custom portrait placement mode:

For the test:
Code: ags

Speech.CustomPortraitPlacement = true;
Speech.PortraitXOffset = 10;
Speech.PortraitY = 10;
cOne.Say("The message I'd like to say");
Speech.PortraitY = 110;
cTwo.Say("The message I'd like to say");


Of course, typing "Speech.PortraitX" and "Speech.PortraitY" would be pain, so writing your own custom function may be a way to go, for example:
Code: ags

void SayAtNew(this Character*, int port_y, String text)
{
   Speech.PortraitY = 10;
   this.Say(text);
}

...
cTwo.SayAtNew(110, "The message I'd like to say");



EDIT: I should probably admit (and warn) there there may be still some alignment problems. We tried to address speech position bugs before, long time ago, but not all of them were solved for the time being.

If the aforementioned solution won't work for you for some reason, here is another thing that you may try:
* Disable speech views for the character (or use clear transparent frames with no image).
* Use SayAt command in combination with GUI, having character portrait set as a GUI background. This way you may achieve any possible combination of portrait and text positions.

Kykke

Thanks for your quick reply Wiz :smiley: I'll try those and report back here.

Kykke

I was able to get around the problem with CustomPortraitPlacement and Offset (nod). Thank you so much.

SMF spam blocked by CleanTalk