using UnityEngine;
using mgaia.Utils;

namespace mgaia.tk2d
{
    /// <summary>
    /// Container de TextMesh para os TextMeshs da Tk2d
    /// </summary>
    /// <owner>Victor</owner>
    public class Tk2dTextMeshContainer : ITextMesh
    {
        private tk2dTextMesh mTextMesh;

        public Tk2dTextMeshContainer(tk2dTextMesh textMesh)
        {
            mTextMesh = textMesh;
        }

        public Bounds GetEstimatedMeshBoundsForString(string text)
        {
            return mTextMesh.GetEstimatedMeshBoundsForString(text);
        }

        public string Text
        {
            get
            {
                return mTextMesh.text;
            }
            set
            {
                mTextMesh.text = value;

                //FIX PARA FORÇAR O REFRESH DE CORES EM LABELS MULTICOLORIDOS
                mTextMesh.color = mTextMesh.color;
            }
        }

        public Vector3 Scale
        {
            get
            {
                return mTextMesh.scale;
            }
            set
            {
                mTextMesh.scale = value;
            }
        }


		public int MaxChars
		{
			get
			{
				return mTextMesh.maxChars;
			}
			set
			{
				mTextMesh.maxChars = value;
			}
		}
	}
}