TextMesh.anchor Manual     Reference     Scripting  
Scripting > Runtime Classes > TextMesh
TextMesh.anchor

var anchor : TextAnchor

Description

Which point of the text shares the position of the Transform

JavaScripts
GetComponent(TextMesh).anchor = TextAnchor.MiddleCenter;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
GetComponent<TextMesh>().anchor = TextAnchor.MiddleCenter;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
GetComponent[of TextMesh]().anchor = TextAnchor.MiddleCenter