Hi Everyone!
I’m Luca and I’m new here.
I am trying to develop an RPG in my spare time and without too many pretensions.
A few months ago I implemented the “LocalizationSystem”. Everything worked correctly.
A month ago I created a combat log, but every time I exceeded a limited number of characters Unity signaled me that I exceeded 65,000 vertices and the Log disappeared.
I solved by replacing the text box in my UI with a TextMeshPro.
When i play in english everything works correctly, but when I play in Italian the localized words are all shifted to the left as you can see in the attached image.
Just to give some more info, these are the variables in my BattleLogManager:
public class BattleLogManager : MonoBehaviour
{
public static BattleLogManager instance;
public TMP_Text battleLogText;
public Image battleLogImage;
public ScrollRect combatLogScrollRect;
public int maxLogLenght;
public List<string> combatLog;
...
this is the script to add a string to the Log:
public void addLog (string LogToAdd)
{
combatLog.Add(LogToAdd);
if (combatLog.Count >= maxLogLenght)
{
combatLog.RemoveAt(0);
}
string combatLogText = "";
for (int i = 0; i < combatLog.Count; i++)
{
if (combatLog[i] != "")
{
combatLogText = combatLogText + combatLog[i] + "\n";
}
}
battleLogText.text = combatLogText;
combatLogScrollRect.velocity = new Vector2(0f, 1000f);
newLogTimer = 5f;
FadeIn();
}
and these are examples of how I call that script to add a string:
BattleLogManager.instance.addLog(activeBattlers[currentTurn].charName + " " + LocalisationSystem.GetLocalisedValue("attack") + " (" + LocalisationSystem.GetLocalisedValue(theMove.moveName) + ") " + activeBattlers[selectedTarget].charName);
or:
BattleLogManager.instance.addLog(activeBattlers[currentTurn].charName + " " + LocalisationSystem.GetLocalisedValue("deal") + " " + damageToGive + " " + LocalisationSystem.GetLocalisedValue("damage") + " " + LocalisationSystem.GetLocalisedValue("to") + " " + activeBattlers[target].charName);
Now I have two questions:
- does anyone know the reason of this problem with the justification of words ?
- is there a more elegant way with TMP to add a single text string to the screen instead of reloading the whole list of strings every time I add one like I do now?
Thank you all for the time you dedicate to me even just reading these lines.



