Hi.
I'm having trouble with UILabel.
I apologize for my google English.
Unity 3d 5.2.1f1
Playmaker 1.7.8.3p2
NGUI 3.9.4b
The screens that follow are only an example, I made notes on them.
In my game texts are dynamically changed several times according to user interaction.
The problem is that when loaded with the text through a String Global Playmaker, The texts are justified through the character, causing the line breaks in the middle of words. The texts are configured to align the left.
Sera that this string has to be treated before being loaded into the UI Label?
2 following examples.
Before play.
IMAGE
https://www.dropbox.com/s/5eavkvmmy45lqc5/1.jpg?dl=0
To play with the code as well.
using UnityEngine;
using System.Collections;
public class setTextNGUI : MonoBehaviour {
void Start() {
string txt = "Não se preocupem com nada, mas em todas as orações peçam a Deus o que vocês precisam e orem sempre com o coração agradecido. E a paz de Deus, que ninguém consegue entender, guardará o coração e a mente de vocês, pois vocês estão unidos com Cristo Jesus.";
UILabel lbl = GetComponent<UILabel>();
lbl.text = txt;
}
}
IMAGE.
https://www.dropbox.com/s/hwibowav87uiymg/2.jpg?dl=0
Causing the problem:
using UnityEngine;
using System.Collections;
using HutongGames.PlayMaker;
public class setTextNGUI : MonoBehaviour {
void Start() {
string txt = FsmVariables.GlobalVariables.GetFsmString ("msgTexto").Value;
UILabel lbl = GetComponent<UILabel>();
lbl.text = txt;
}
}
IMAGE
https://www.dropbox.com/s/79iq7r68ih342b4/3.jpg?dl=0
I'm using void Start () only for testing. It will be a function called via a button.
Could anyone help me? Am I doing something wrong?