The mystery is solved and it was my settings!
Still a noob at this stuff -
It turns out I had selected the original .png file for the texture map - And not the atlas created tex from the sprite atlas obj. Which is why the texture was misaligned.
I must have set this when I could not see the font at all before I scaled it up in size.
Its now working perfectly thanks for your help!
However, I am now having trouble accessing the text mesh -
Ive tried making the text mesh as the child of the OBJ where the code is being run, and also having it separate as its own object -
But I keep getting,
Does not exist in the current context
or
Type `UnityEngine.GameObject' does not contain a definition for `mytextobj' and no extension method ....
I think there is some confusion for me around variables, scope and syntax for getting and setting -
It is also hard to understand the code examples I have found as the term, "textmesh" is used and I am not sure if this is an instance name or a class name, or something else -
Here are the examples I have been experimenting with -
var myTextMesh = (GetComponent(TextMesh) as TextMesh);
myTextMesh.text = "Pls work";
//and from unity script reference -
public class example : MonoBehaviour {
void Example() {
GetComponent<TextMesh>().text = "Hello World";
}
}
Any advice around how to get this up and running would be great -
Thanks,
Chris.