Hi,
i've decided that in the subtitles menu i want to have the name label not above the text but in front of the text.
With layouts this is basically imposible to get the positioning right though.
The next lines are supposed to be centered to the whole width not just to the line text width.
So probably the best way to achieve this would be making the label part of the text itself. But how do i do it?
I know there's the
OnSpeech event & i can access the label with
AC.PlayerMenus.GetElementWithName("Subtitles", "SubsLineLabel") but how do i edit the label's text?
The idea is something like this:
void OnSpeech(AC.Char speakingCharacter, string speechText, int lineID) {
AC.PlayerMenus.GetElementWithName("Subtitles", "SubsLineLabel").Text = speakingCharacter.name + ": " + speechText;
}
I would like to update the label's text not the line itself. So when the line is called again i wouldn't have the name label inserted multiple times.
Could anyone please explain me please what does really the Subtitles off option do?
If i set it to off the subtitles menu is still visible when the character speaks. If i check the Ignore subtitles options the subtitles menu and text is still visible.
Thanks
Comments
In order to set the text of a label element, you first need to cast the element variable:
The Settings Manager's Show subtitles? option will be ignored if no speech audio is associated with the current speech line. If a line has audio, and Show subtitles? is unchecked, then the Subtitles menu will not show (unless its own Ignore 'Subtitles' option? is checked). You can prevent your Subtitles Menu from showing at any time by checking Start game locked off? in its own list of properties.
In a way i was trying to recreate the CSS float property, but that still really only works with text aligned to left.
https://codepen.io/emilychews/pen/GmdZOb
Yeah i know i was trying to do it with Unity UI.
There's the main container and inside i want to display the speech text. I'm not sure it's possible to have the name label and speech text as two separate objects and achieve the desired positioning.
1. The should't be a blank space between the name and speech text.
2. The text should be centered to the whole container width not just to the speech text.
And thus that's i want to make the label part of the text itself.
So the goal is whenever a speach text is displayed insert a character's name into the text that the label holds.
I've tried the thing you've suggested but it doesn't seem to be affecting the displayed text.
Thanks for clarifying the subtitles off / on thing.