EffectStyle

We found 10 examples in language CSharp for this search. You will see 34 fragments of code.
	/// <summary>
	/// 设置Label字体的描边.
	/// </summary>
	void SetLabelOutlineColor()
	{
		if (label != null) 
		{
			if(bShowOutLine&&OutlineColor!=TxtOutlineColor.None)
			{
				label.effectStyle = UILabel.Effect.Outline;
				label.effectColor = ColorSet.getOutlineColor(OutlineColor);
				label.effectDistance = new Vector2(0.78f,0.5f);
			}
			else
			{
				label.effectStyle = UILabel.Effect.None;
			}
		}

	}


		#endregion

		#region Methods

		protected override bool CanSubmit ()
		{
			if (ValidateSubmit != null)
				return ValidateSubmit (SelectedItem);
			
			return true;
		}

		protected override void HandleSubmit ()
		{
			SelectionDidChange(SelectedItem);
		}

		/// <summary>
		/// Called when the selection did change
		/// </summary>
		/// <param name="item">Item.</param>
		internal void SelectionDidChange(string item)
		{
			OnSelectedItemChanged (this, item);
		}

		#endregion

		#region static Methods

		/// <summary>
		/// Shows the dialog on the window
		/// </summary>
		/// <returns>The dialog async.</returns>
		/// <param name="title">Title.</param>
		/// <param name="message">Message.</param>
		/// <param name="items">Items.</param>
		/// <param name="selectedItem">Selected item.</param>
		/// <param name="effectStyle">Effect style.</param>
		public static Task<String> ShowDialogAsync(String title, String message, List<String> items, String selectedItem = null, UIBlurEffectStyle effectStyle = UIBlurEffectStyle.ExtraLight)
		{
			var tcs = new TaskCompletionSource<String> ();


			new NSObject ().BeginInvokeOnMainThread (() => {

				var dialog = new XamSimplePickerDialog(items)
				{
					Title = title,
					Message = message,
					BlurEffectStyle = effectStyle,
					ConstantUpdates = false,
				};

				if (!String.IsNullOrWhiteSpace(selectedItem))
					dialog.SelectedItem = selectedItem;

				dialog.OnCancel += (object sender, EventArgs e) => 
				{
					tcs.SetResult(null);
				};

				dialog.OnSelectedItemChanged += (object s, string e) => 
				{
					tcs.SetResult(dialog.SelectedItem);
				};

				dialog.Show();

			});

			return tcs.Task;
		}
			
		/// <summary>
		/// Shows the dialog on the specified View Controller
		/// </summary>
		/// <returns>The dialog async.</returns>
		/// <param name="vc">The view controlller</param>
		/// <param name="title">Title.</param>
		/// <param name="message">Message.</param>
		/// <param name="items">Items.</param>
		/// <param name="selectedItem">Selected item.</param>
		/// <param name="effectStyle">Effect style.</param>
		public static Task<String> ShowDialogAsync(UIViewController vc, String title, String message, List<String> items, String selectedItem = null, UIBlurEffectStyle effectStyle = UIBlurEffectStyle.ExtraLight)
		{
			var tcs = new TaskCompletionSource<String> ();


			new NSObject ().BeginInvokeOnMainThread (() => {

				var dialog = new XamSimplePickerDialog(items)
				{
					Title = title,
					Message = message,
					BlurEffectStyle = effectStyle,
					ConstantUpdates = false,
				};

				if (!String.IsNullOrWhiteSpace(selectedItem))
					dialog.SelectedItem = selectedItem;

				dialog.OnCancel += (object sender, EventArgs e) => 
				{
					tcs.SetResult(null);
				};

				dialog.OnSelectedItemChanged += (object s, string e) => 
				{
					tcs.SetResult(dialog.SelectedItem);
				};

				dialog.Show(vc);

			});

			return tcs.Task;
		}

			public override nint GetComponentCount (UIPickerView v)
			{
				return 1;
			}

    // Use this for initialization
    void Start () {
        under.mainTexture = GameTextureManager.bar;
        api_healthBar.mainTexture = GameTextureManager.lp;
        api_timeBar.mainTexture = GameTextureManager.time;
        try
        {
            string[] allLines = (File.ReadAllText("texture\\duel\\healthBar\\config.txt").Replace("\r", "").Replace(" ", "").Split("\n"));
            foreach (var item in allLines)
            {
                string[] mats = item.Split("=");
                if (mats.Length == 2)
                {
                    Color c;
                    switch (mats[0])
                    {
                        case "totalSize.width":
                            under.width = int.Parse(mats[1]);
                            under.transform.localPosition = new Vector3(-float.Parse(mats[1]) / 2f, under.transform.localPosition.y, 0);
                            break;
                        case "flatType":
                            if (int.Parse(mats[1]) == 1)
                            {
                                healthBarCC.clipSoftness = new Vector2(0, 0);
                                timeBarCC.clipSoftness = new Vector2(0, 0);
                            }
                            else
                            {
                                healthBarCC.clipSoftness = new Vector2(4, 4);
                                timeBarCC.clipSoftness = new Vector2(4, 4);
                            }
                            break;
                        case "totalSize.height":
                            under.height = int.Parse(mats[1]);
                            under.transform.localPosition = new Vector3(under.transform.localPosition.x, -float.Parse(mats[1]) / 2f, 0);
                            break;
                        case "playerNameLable.x":
                            api_name.transform.localPosition = new Vector3(-float.Parse(mats[1]), api_name.transform.localPosition.y, 0);
                            break;
                        case "playerNameLable.y":
                            api_name.transform.localPosition = new Vector3(api_name.transform.localPosition.x, -float.Parse(mats[1]), 0);
                            break;
                        case "playerNameLable.width":
                            api_name.width = int.Parse(mats[1]);
                            break;
                        case "playerNameLable.height":
                            api_name.height = int.Parse(mats[1]);
                            break;
                        case "playerNameLable.color":
                            Color.TryParseHexString(mats[1],out c);
                            api_name.color = c;
                            api_name.gradientTop = api_name.color;
                            break;
                        case "playerNameLable.alignment":
                            if (mats[1] == "0")
                            {
                                api_name.alignment = NGUIText.Alignment.Center;
                            }
                            if (mats[1] == "1")
                            {
                                api_name.alignment = NGUIText.Alignment.Left;
                            }
                            if (mats[1] == "2")
                            {
                                api_name.alignment = NGUIText.Alignment.Right;
                            }
                            break;
                        case "playerNameLable.effect":
                            if (mats[1] == "0")
                            {
                                api_name.effectStyle = UILabel.Effect.None;
                            }
                            if (mats[1] == "1")
                            {
                                api_name.effectStyle = UILabel.Effect.Shadow;
                            }
                            if (mats[1] == "2")
                            {
                                api_name.effectStyle = UILabel.Effect.Outline;
                            }
                            break;
                        case "healthLable.x":
                            api_healthHint.transform.localPosition = new Vector3(-float.Parse(mats[1]), api_healthHint.transform.localPosition.y, 0);
                            break;
                        case "healthLable.y":
                            api_healthHint.transform.localPosition = new Vector3(api_healthHint.transform.localPosition.x, -float.Parse(mats[1]), 0);
                            break;
                        case "healthLable.width":
                            api_healthHint.width = int.Parse(mats[1]);
                            break;
                        case "healthLable.height":
                            api_healthHint.height = int.Parse(mats[1]);
                            break;
                        case "healthLable.color":
                            Color.TryParseHexString(mats[1], out c);
                            api_healthHint.color = c;
                            api_healthHint.gradientTop = api_name.color;
                            break;
                        case "healthLable.alignment":
                            if (mats[1] == "0")
                            {
                                api_healthHint.alignment = NGUIText.Alignment.Center;
                            }
                            if (mats[1] == "1")
                            {
                                api_healthHint.alignment = NGUIText.Alignment.Left;
                            }
                            if (mats[1] == "2")
                            {
                                api_healthHint.alignment = NGUIText.Alignment.Right;
                            }
                            break;
                        case "healthLable.effect":
                            if (mats[1] == "0")
                            {
                                api_healthHint.effectStyle = UILabel.Effect.None;
                            }
                            if (mats[1] == "1")
                            {
                                api_healthHint.effectStyle = UILabel.Effect.Shadow;
                            }
                            if (mats[1] == "2")
                            {
                                api_healthHint.effectStyle = UILabel.Effect.Outline;
                            }
                            break;
                        case "timeLable.x":
                            api_timeHint.transform.localPosition = new Vector3(-float.Parse(mats[1]), api_timeHint.transform.localPosition.y, 0);
                            break;
                        case "timeLable.y":
                            api_timeHint.transform.localPosition = new Vector3(api_timeHint.transform.localPosition.x, -float.Parse(mats[1]), 0);
                            break;
                        case "timeLable.width":
                            api_timeHint.width = int.Parse(mats[1]);
                            break;
                        case "timeLable.height":
                            api_timeHint.height = int.Parse(mats[1]);
                            break;
                        case "timeLable.color":
                            Color.TryParseHexString(mats[1], out c);
                            api_timeHint.color = c;
                            api_timeHint.gradientTop = api_name.color;
                            break;
                        case "timeLable.alignment":
                            if (mats[1] == "0")
                            {
                                api_timeHint.alignment = NGUIText.Alignment.Center;
                            }
                            if (mats[1] == "1")
                            {
                                api_timeHint.alignment = NGUIText.Alignment.Left;
                            }
                            if (mats[1] == "2")
                            {
                                api_timeHint.alignment = NGUIText.Alignment.Right;
                            }
                            break;
                        case "timeLable.effect":
                            if (mats[1] == "0")
                            {
                                api_timeHint.effectStyle = UILabel.Effect.None;
                            }
                            if (mats[1] == "1")
                            {
                                api_timeHint.effectStyle = UILabel.Effect.Shadow;
                            }
                            if (mats[1] == "2")
                            {
                                api_timeHint.effectStyle = UILabel.Effect.Outline;
                            }
                            break;
                        case "health.x":
                            healthBarCC.transform.localPosition = new Vector3(-float.Parse(mats[1]), healthBarCC.transform.localPosition.y, 0);
                            api_healthBar.transform.localPosition = Vector3.zero;
                            break;
                        case "health.y":
                            healthBarCC.transform.localPosition = new Vector3(healthBarCC.transform.localPosition.x, -float.Parse(mats[1]), 0);
                            api_healthBar.transform.localPosition = Vector3.zero;
                            break;
                        case "health.width":
                            healthBarCC.baseClipRegion = new Vector4(healthBarCC.baseClipRegion.x, healthBarCC.baseClipRegion.y, float.Parse(mats[1]), healthBarCC.baseClipRegion.w);
                            api_healthBar.width = int.Parse(mats[1]);
                            break;
                        case "health.height":
                            healthBarCC.baseClipRegion = new Vector4(healthBarCC.baseClipRegion.x, healthBarCC.baseClipRegion.y, healthBarCC.baseClipRegion.z, float.Parse(mats[1]));
                            api_healthBar.height = int.Parse(mats[1]);
                            break;
                        case "time.x":
                            timeBarCC.transform.localPosition = new Vector3(-float.Parse(mats[1]), timeBarCC.transform.localPosition.y, 0);
                            api_timeBar.transform.localPosition = Vector3.zero;
                            break;
                        case "time.y":
                            timeBarCC.transform.localPosition = new Vector3(timeBarCC.transform.localPosition.x, -float.Parse(mats[1]), 0);
                            api_timeBar.transform.localPosition = Vector3.zero;
                            break;
                        case "time.width":
                            timeBarCC.baseClipRegion = new Vector4(timeBarCC.baseClipRegion.x, timeBarCC.baseClipRegion.y, float.Parse(mats[1]), timeBarCC.baseClipRegion.w);
                            api_timeBar.width = int.Parse(mats[1]);
                            break;
                        case "time.height":
                            timeBarCC.baseClipRegion = new Vector4(timeBarCC.baseClipRegion.x, timeBarCC.baseClipRegion.y, timeBarCC.baseClipRegion.z, float.Parse(mats[1]));
                            api_timeBar.height = int.Parse(mats[1]);
                            break;
                        case "face.x":
                            faceCC.transform.localPosition = new Vector3(-float.Parse(mats[1]), faceCC.transform.localPosition.y, 0);
                            api_timeBar.transform.localPosition = Vector3.zero;
                            break;
                        case "face.y":
                            faceCC.transform.localPosition = new Vector3(faceCC.transform.localPosition.x, -float.Parse(mats[1]), 0);
                            api_timeBar.transform.localPosition = Vector3.zero;
                            break;
                        case "face.size":
                            faceCC.baseClipRegion = new Vector4(faceCC.baseClipRegion.x, faceCC.baseClipRegion.y, float.Parse(mats[1]), float.Parse(mats[1]));
                            api_face.width = int.Parse(mats[1]);
                            api_face.height = int.Parse(mats[1]);
                            break;
                        case "face.type":
                            if (mats[1] == "0")
                            {
                                faceCC.clipping = UIDrawCall.Clipping.TextureMask;
                            }
                            if (mats[1] == "1")
                            {
                                faceCC.clipping = UIDrawCall.Clipping.SoftClip;
                            }
                            break;
                    }
                }
            }
        }
        catch (System.Exception e)  
        {
            Debug.LogError(e);
        }
    }

    public void LoadResourceInsteadOfAwake()
    {
        if (m_bLoadResourceInsteadOfAwake)
            return;

        m_bLoadResourceInsteadOfAwake = true;

        m_myTransform = transform;
        FillFullNameData(m_myTransform);

        m_lblCDText = FindTransform("TimeLimitActivityCDText").GetComponentsInChildren<UILabel>(true)[0];
        m_spGridFG = FindTransform("TimeLimitActivityGridFG").GetComponentsInChildren<UISprite>(true)[0];
        m_lblTitleText = FindTransform("TimeLimitActivityTitleText").GetComponentsInChildren<UILabel>(true)[0];
        m_goTimeLimitActivityHasReward = FindTransform("TimeLimitActivityHasReward").gameObject;
        m_goTimeLimitActivityGridFinishFX = FindTransform("TimeLimitActivityGridFinishFX").gameObject;
    } 

    void OnPress(bool isPressed)
    {
        if (!isPressed)
        {
            if (!m_bIsDragging)
            {
                EventDispatcher.TriggerEvent<int>(TimeLimitActivityUILogicManager.TimeLimitActivityUIEvent.ActivityGridUp, Id);
            }

            m_bIsDragging = false;
        }
    }

    void OnDrag(Vector2 v)
    {
        m_bIsDragging = true;
    }

    public void SetCountDownStop()
    {
        if (countDown != null)
            countDown.StopCountDown();
    }

    /// <summary>
    /// ���û״̬-���ݲ�ͬ״̬����UI
    /// </summary>
    /// <param name="status"></param>
    public void SetActivityStatus(ActivityStatus status)
    {
        switch (status)
        {
            case ActivityStatus.HasReward:
                {
                    m_lblCDText.effectStyle = UILabel.Effect.Outline;
                    m_lblCDText.effectColor = SystemUIColorManager.WHITE_OUTLINE;
                    m_lblCDText.color = SystemUIColorManager.WHITE;

                    m_lblTitleText.effectStyle = UILabel.Effect.Outline;
                    m_lblTitleText.effectColor = SystemUIColorManager.WHITE_OUTLINE;
                    m_lblTitleText.color = SystemUIColorManager.WHITE;

                    m_goTimeLimitActivityHasReward.SetActive(true);
                    ShowActivityFinishedAnim(false);
                }
                break;
            case ActivityStatus.HasFinished:
                {
                    m_lblCDText.effectStyle = UILabel.Effect.Outline;
                    m_lblCDText.effectColor = SystemUIColorManager.YELLOW_OUTLINE;
                    m_lblCDText.color = SystemUIColorManager.YELLOW;

                    m_lblTitleText.effectStyle = UILabel.Effect.Outline;
                    m_lblTitleText.effectColor = SystemUIColorManager.YELLOW_OUTLINE;
                    m_lblTitleText.color = SystemUIColorManager.YELLOW;

                    m_goTimeLimitActivityHasReward.SetActive(false);
                    ShowActivityFinishedAnim(true);
                }
                break;
            case ActivityStatus.TimeUseUp:
                {
                    m_lblCDText.effectStyle = UILabel.Effect.Outline;
                    m_lblCDText.effectColor = SystemUIColorManager.WHITE_OUTLINE;
                    m_lblCDText.color = SystemUIColorManager.WHITE;

                    m_lblTitleText.effectStyle = UILabel.Effect.Outline;
                    m_lblTitleText.effectColor = SystemUIColorManager.WHITE_OUTLINE;
                    m_lblTitleText.color = SystemUIColorManager.WHITE;

                    m_goTimeLimitActivityHasReward.SetActive(false);
                    ShowActivityFinishedAnim(false);
                }
                break;
            case ActivityStatus.OtherStatus:
                {
                    m_lblCDText.effectStyle = UILabel.Effect.None;
                    m_lblCDText.color = SystemUIColorManager.BROWN;

                    m_lblTitleText.effectStyle = UILabel.Effect.None;
                    m_lblTitleText.color = SystemUIColorManager.BROWN;

                    m_goTimeLimitActivityHasReward.SetActive(false);
                    ShowActivityFinishedAnim(false);
                }
                break;
            default:
                break;
        }
    }

    /// <summary>
    /// ��ʾ��������ʱ������Ч
    /// </summary>
    /// <param name="isShow"></param>
    /// <param name="id"></param>
    private void ShowActivityFinishedAnim(bool isShow)
    {
        if (isShow)
        {
            if (TimeLimitActivityUIViewManager.Instance != null)
            {
                TimeLimitActivityUIViewManager.Instance.AttachFXToTimeLimitActivityUI("fx_ui_skill_yes.prefab", Id, Index);
            }            
        }
        else
        {
            if (TimeLimitActivityUIViewManager.Instance != null)
            {
                TimeLimitActivityUIViewManager.Instance.ReleaseFXFromActivityUI(Id);
            }            
        }
    }


		private void Awake()
		{
			if (this.theLabel == null)
			{
				this.theLabel = base.transform.GetComponent<UILabel>();
			}
		}

		private void Start()
		{
			this.StoreLabelStyle(false);
		}

		public void RenderLabel(int rank)
		{
			this.StoreLabelStyle(false);
			this.CheckCharmRank(rank);
			this.ApplyStyle(this.recordStyle);
		}

		public void FriendRenderLabel(int rank)
		{
			this.CheckCharmRank(rank);
			this.FriendApplyStyle(this.recordStyle);
		}

		[ContextMenu("Refresh")]
		public void Refresh()
		{
		}

		public void Refresh(ELabelStyle _style)
		{
			if (_style == this.recordStyleRecord)
			{
				return;
			}
			this.ApplyStyle(_style);
		}


	/// <summary>
	/// Register an Undo command with the Unity editor.
	/// </summary>

	void RegisterUndo () { NGUIEditorTools.RegisterUndo("Label Change", mLabel); }

	/// <summary>
	/// Font selection callback.
	/// </summary>

	void OnSelectFont (MonoBehaviour obj)
	{
		if (mLabel != null)
		{
			NGUIEditorTools.RegisterUndo("Font Selection", mLabel);
			bool resize = (mLabel.font == null);
			mLabel.font = obj as UIFont;
			if (resize) mLabel.MakePixelPerfect();
		}
	}

	override protected bool DrawProperties ()
	{
		mLabel = mWidget as UILabel;
		ComponentSelector.Draw<UIFont>(mLabel.font, OnSelectFont);
		if (mLabel.font == null) return false;

		GUI.skin.textArea.wordWrap = true;
		string text = string.IsNullOrEmpty(mLabel.text) ? "" : mLabel.text;
		text = EditorGUILayout.TextArea(mLabel.text, GUI.skin.textArea, GUILayout.Height(100f));
		if (!text.Equals(mLabel.text)) { RegisterUndo(); mLabel.text = text; }

		GUILayout.BeginHorizontal();
		{
			int len = EditorGUILayout.IntField("Line Width", mLabel.lineWidth, GUILayout.Width(120f));
			if (len != mLabel.lineWidth) { RegisterUndo(); mLabel.lineWidth = len; }

			int count = EditorGUILayout.IntField("Line Count", mLabel.maxLineCount, GUILayout.Width(100f));
			if (count != mLabel.maxLineCount) { RegisterUndo(); mLabel.maxLineCount = count; }
		}
		GUILayout.EndHorizontal();

		GUILayout.BeginHorizontal();

		bool password = EditorGUILayout.Toggle("Password", mLabel.password, GUILayout.Width(120f));
		if (password != mLabel.password) { RegisterUndo(); mLabel.password = password; }

		bool encoding = EditorGUILayout.Toggle("Encoding", mLabel.supportEncoding, GUILayout.Width(100f));
		if (encoding != mLabel.supportEncoding) { RegisterUndo(); mLabel.supportEncoding = encoding; }

		GUILayout.EndHorizontal();

		if (encoding && mLabel.font.hasSymbols)
		{
			UIFont.SymbolStyle sym = (UIFont.SymbolStyle)EditorGUILayout.EnumPopup("Symbols", mLabel.symbolStyle, GUILayout.Width(170f));
			if (sym != mLabel.symbolStyle) { RegisterUndo(); mLabel.symbolStyle = sym; }
		}

		GUILayout.BeginHorizontal();
		{
			UILabel.Effect effect = (UILabel.Effect)EditorGUILayout.EnumPopup("Effect", mLabel.effectStyle, GUILayout.Width(170f));
			if (effect != mLabel.effectStyle) { RegisterUndo(); mLabel.effectStyle = effect; }

			if (effect != UILabel.Effect.None)
			{
				Color c = EditorGUILayout.ColorField(mLabel.effectColor);
				if (mLabel.effectColor != c) { RegisterUndo(); mLabel.effectColor = c; }
			}
		}
		GUILayout.EndHorizontal();

		if (mLabel.effectStyle != UILabel.Effect.None)
		{
			GUILayout.Label("Distance", GUILayout.Width(70f));
			GUILayout.Space(-34f);
			GUILayout.BeginHorizontal();
			GUILayout.Space(70f);
			Vector2 offset = EditorGUILayout.Vector2Field("", mLabel.effectDistance);
			GUILayout.Space(20f);

			if (offset != mLabel.effectDistance)
			{
				RegisterUndo();
				mLabel.effectDistance = offset;
			}
			GUILayout.EndHorizontal();
		}
		return true;
	}

        protected override void OnFreshView()
        { 
            var sfsdata = GetData<ISFSObject> ();
            if (sfsdata == null) return;
            var gdata = App.GetGameData<BrnnGameData>();
            gdata.GetPlayerInfo().CoinA = sfsdata.GetLong("gold");
            var labelStylt = gdata.ResultUserTotal >= 0 ? WinLabelStyle : LoseLabelStyle;
            ResultMe.Text(gdata.ResultUserTotal);
            SetLabelStyle(ResultMe, labelStylt);
            labelStylt = gdata.ResultBnakerTotal >= 0 ? WinLabelStyle : LoseLabelStyle;
            SetLabelStyle(ResultBanker, labelStylt);
            ResultBanker.Text(gdata.ResultBnakerTotal);
            gameObject.SetActive(true);
            Invoke("Hide", 6);
        }

        public virtual void ShowResultView(ISFSObject response)
        {
            ShowWithData(response);
        }

        protected void SetLabelStyle(NguiLabelAdapter labelAdapter,LabelStyle style)
        {
            var label = labelAdapter.Label;
            if (style.ApplyGradient)
            {
                label.applyGradient = true;
                label.gradientBottom = style.GradientBottom;
                label.gradientTop = style.GradientTop;
            }   
            if (style.EffectStyle != UILabel.Effect.None)
            {
                label.effectStyle = style.EffectStyle;
                label.effectColor = style.EffectColor;
                label.effectDistance = style.EffectDistance;
            }

        }


	// Use this for initialization
	void Awake()
	{
		label = GetComponent<UILabel>();
		ApplyStyle();
	}


	void ApplyStyle()
	{

		if (GetComponents<LabelFontStyle>().Length > 1)
		{
			DestroyImmediate(this);
			return;
		}

		if (GetComponents<UILabel>().Length == 0)
		{
			DestroyImmediate(this);
			return;
		}


		if (label != null)
		{
			if (sample!=null)
			{
				label.color = sample.color;
				label.spacingX = sample.spacingX;
				label.spacingY = sample.spacingY;

				label.applyGradient = sample.applyGradient;
				//sd
				label.diagonalGradient = sample.diagonalGradient;
				label.gradientBottom = sample.gradientBottom;
				label.gradientTop = sample.gradientTop;

				label.symbolStyle = sample.symbolStyle;
				label.effectStyle = sample.effectStyle;
				if (label.effectStyle!=UILabel.Effect.None)
				{
					label.effectDistance = sample.effectDistance;
					label.effectColor = sample.effectColor;
					label.effectColorBottom = sample.effectColorBottom;
				}
				sample = null;
			}
		}
	}


	/// <summary>
	/// Register an Undo command with the Unity editor.
	/// </summary>

	void RegisterUndo () { NGUIEditorTools.RegisterUndo("Label Change", mLabel); }

	/// <summary>
	/// Font selection callback.
	/// </summary>

	void OnSelectFont (MonoBehaviour obj)
	{
		if (mLabel != null)
		{
			NGUIEditorTools.RegisterUndo("Font Selection", mLabel);
			bool resize = (mLabel.font == null);
			mLabel.font = obj as UIFont;
			if (resize) mLabel.MakePixelPerfect();
		}
	}

	protected override bool DrawProperties ()
	{
		mLabel = mWidget as UILabel;
		ComponentSelector.Draw<UIFont>(mLabel.font, OnSelectFont);

		if (mLabel.font != null)
		{
			GUI.skin.textArea.wordWrap = true;
			string text = string.IsNullOrEmpty(mLabel.text) ? "" : mLabel.text;
			text = EditorGUILayout.TextArea(mLabel.text, GUI.skin.textArea, GUILayout.Height(100f));
			if (!text.Equals(mLabel.text)) { RegisterUndo(); mLabel.text = text; }

			GUILayout.BeginHorizontal();
			int len = EditorGUILayout.IntField("Max Width", mLabel.lineWidth, GUILayout.Width(120f));
			GUILayout.Label("pixels");
			GUILayout.EndHorizontal();
			if (len != mLabel.lineWidth && len >= 0f) { RegisterUndo(); mLabel.lineWidth = len; }

			GUILayout.BeginHorizontal();
			len = EditorGUILayout.IntField("Max Height", mLabel.lineHeight, GUILayout.Width(120f));
			GUILayout.Label("pixels");
			GUILayout.EndHorizontal();
			if (len != mLabel.lineHeight && len >= 0f) { RegisterUndo(); mLabel.lineHeight = len; }

			int count = EditorGUILayout.IntField("Max Lines", mLabel.maxLineCount, GUILayout.Width(100f));
			if (count != mLabel.maxLineCount) { RegisterUndo(); mLabel.maxLineCount = count; }

			GUILayout.BeginHorizontal();
			bool shrinkToFit = EditorGUILayout.Toggle("Shrink to Fit", mLabel.shrinkToFit, GUILayout.Width(100f));
			GUILayout.Label("- adjust scale to fit");
			GUILayout.EndHorizontal();
			
			if (shrinkToFit != mLabel.shrinkToFit)
			{
				RegisterUndo();
				mLabel.shrinkToFit = shrinkToFit;
				if (!shrinkToFit) mLabel.MakePixelPerfect();
			}

			// Only input fields need this setting exposed, and they have their own "is password" setting, so hiding it here.
			//GUILayout.BeginHorizontal();
			//bool password = EditorGUILayout.Toggle("Password", mLabel.password, GUILayout.Width(100f));
			//GUILayout.Label("- hide characters");
			//GUILayout.EndHorizontal();
			//if (password != mLabel.password) { RegisterUndo(); mLabel.password = password; }

			GUILayout.BeginHorizontal();
			bool encoding = EditorGUILayout.Toggle("Encoding", mLabel.supportEncoding, GUILayout.Width(100f));
			GUILayout.Label("- use emoticons and colors");
			GUILayout.EndHorizontal();
			if (encoding != mLabel.supportEncoding) { RegisterUndo(); mLabel.supportEncoding = encoding; }

			//GUILayout.EndHorizontal();

			if (encoding && mLabel.font.hasSymbols)
			{
				UIFont.SymbolStyle sym = (UIFont.SymbolStyle)EditorGUILayout.EnumPopup("Symbols", mLabel.symbolStyle, GUILayout.Width(170f));
				if (sym != mLabel.symbolStyle) { RegisterUndo(); mLabel.symbolStyle = sym; }
			}

			GUILayout.BeginHorizontal();
			{
				UILabel.Effect effect = (UILabel.Effect)EditorGUILayout.EnumPopup("Effect", mLabel.effectStyle, GUILayout.Width(170f));
				if (effect != mLabel.effectStyle) { RegisterUndo(); mLabel.effectStyle = effect; }

				if (effect != UILabel.Effect.None)
				{
					Color c = EditorGUILayout.ColorField(mLabel.effectColor);
					if (mLabel.effectColor != c) { RegisterUndo(); mLabel.effectColor = c; }
				}
			}
			GUILayout.EndHorizontal();

			if (mLabel.effectStyle != UILabel.Effect.None)
			{
				GUILayout.Label("Distance", GUILayout.Width(70f));
				GUILayout.Space(-34f);
				GUILayout.BeginHorizontal();
				GUILayout.Space(70f);
				Vector2 offset = EditorGUILayout.Vector2Field("", mLabel.effectDistance);
				GUILayout.Space(20f);

				if (offset != mLabel.effectDistance)
				{
					RegisterUndo();
					mLabel.effectDistance = offset;
				}
				GUILayout.EndHorizontal();
			}
			return true;
		}
		EditorGUILayout.Space();
		return false;
	}


	/// <summary>
	/// Register an Undo command with the Unity editor.
	/// </summary>

	void RegisterUndo () { NGUIEditorTools.RegisterUndo("Label Change", mLabel); }

	/// <summary>
	/// Font selection callback.
	/// </summary>

	void OnSelectFont (MonoBehaviour obj)
	{
		if (mLabel != null)
		{
			NGUIEditorTools.RegisterUndo("Font Selection", mLabel);
			bool resize = (mLabel.font == null);
			mLabel.font = obj as UIFont;
			if (resize) mLabel.MakePixelPerfect();
		}
	}

	override protected bool OnDrawProperties ()
	{
		mLabel = mWidget as UILabel;
		ComponentSelector.Draw<UIFont>(mLabel.font, OnSelectFont);
		if (mLabel.font == null) return false;

		GUI.skin.textArea.wordWrap = true;
		string text = string.IsNullOrEmpty(mLabel.text) ? "" : mLabel.text;
		text = EditorGUILayout.TextArea(mLabel.text, GUI.skin.textArea, GUILayout.Height(100f));
		if (!text.Equals(mLabel.text)) { RegisterUndo(); mLabel.text = text; }

		GUILayout.BeginHorizontal();
		{
			int len = EditorGUILayout.IntField("Line Width", mLabel.lineWidth, GUILayout.Width(120f));
			if (len != mLabel.lineWidth) { RegisterUndo(); mLabel.lineWidth = len; }

			int count = EditorGUILayout.IntField("Line Count", mLabel.maxLineCount, GUILayout.Width(100f));
			if (count != mLabel.maxLineCount) { RegisterUndo(); mLabel.maxLineCount = count; }
		}
		GUILayout.EndHorizontal();

		GUILayout.BeginHorizontal();

		bool password = EditorGUILayout.Toggle("Password", mLabel.password, GUILayout.Width(120f));
		if (password != mLabel.password) { RegisterUndo(); mLabel.password = password; }

		bool encoding = EditorGUILayout.Toggle("Encoding", mLabel.supportEncoding, GUILayout.Width(100f));
		if (encoding != mLabel.supportEncoding) { RegisterUndo(); mLabel.supportEncoding = encoding; }

		GUILayout.EndHorizontal();

		if (encoding)
		{
			UIFont.SymbolStyle sym = (UIFont.SymbolStyle)EditorGUILayout.EnumPopup("Symbols", mLabel.symbolStyle, GUILayout.Width(170f));
			if (sym != mLabel.symbolStyle) { RegisterUndo(); mLabel.symbolStyle = sym; }
		}

		GUILayout.BeginHorizontal();
		{
			UILabel.Effect effect = (UILabel.Effect)EditorGUILayout.EnumPopup("Effect", mLabel.effectStyle, GUILayout.Width(170f));
			if (effect != mLabel.effectStyle) { RegisterUndo(); mLabel.effectStyle = effect; }

			if (effect != UILabel.Effect.None)
			{
				Color c = EditorGUILayout.ColorField(mLabel.effectColor);
				if (mLabel.effectColor != c) { RegisterUndo(); mLabel.effectColor = c; }
			}
		}
		GUILayout.EndHorizontal();

		if (mLabel.effectStyle != UILabel.Effect.None)
		{
			GUILayout.Label("Distance", GUILayout.Width(70f));
			GUILayout.Space(-34f);
			GUILayout.BeginHorizontal();
			GUILayout.Space(70f);
			Vector2 offset = EditorGUILayout.Vector2Field("", mLabel.effectDistance);
			GUILayout.Space(20f);

			if (offset != mLabel.effectDistance)
			{
				RegisterUndo();
				mLabel.effectDistance = offset;
			}
			GUILayout.EndHorizontal();
		}
		return true;
	}

DocumentFormat.OpenXml.Drawing.EffectStyle : IEnumerable

Constructors :

public EffectStyle()
public EffectStyle(IEnumerable<OpenXmlElement> childElements = )
public EffectStyle(OpenXmlElement[] childElements = )
public EffectStyle(String outerXml = )

Methods :

public OpenXmlElement CloneNode(Boolean deep = )
public OpenXmlElement get_FirstChild()
public OpenXmlElement get_LastChild()
public Boolean get_HasChildren()
public String get_InnerText()
public Void set_InnerXml(String value = )
public Boolean AddChild(OpenXmlElement newChild = , Boolean throwOnError = True)
public T AppendChild(T newChild = )
public T InsertAfter(T newChild = , OpenXmlElement referenceChild = )
public T InsertBefore(T newChild = , OpenXmlElement referenceChild = )
public T InsertAt(T newChild = , Int32 index = )
public T PrependChild(T newChild = )
public T RemoveChild(T child = )
public Void RemoveAllChildren()
public T ReplaceChild(OpenXmlElement newChild = , T oldChild = )
public Void RemoveAllChildren()
public Void Remove()
public Boolean IsAfter(OpenXmlElement element = )
public Boolean IsBefore(OpenXmlElement element = )
public Void AddAnnotation(Object annotation = )
public T Annotation()
public Object Annotation(Type type = )
public IEnumerable<T> Annotations()
public IEnumerable<Object> Annotations(Type type = )
public Void RemoveAnnotations()
public Void RemoveAnnotations(Type type = )
public IEnumerator<OpenXmlElement> GetEnumerator()
public Object Clone()
public MarkupCompatibilityAttributes get_MCAttributes()
public Void set_MCAttributes(MarkupCompatibilityAttributes value = )
public String LookupNamespace(String prefix = )
public String LookupPrefix(String namespaceUri = )
public IFeatureCollection get_Features()
public OpenXmlElementContext get_OpenXmlElementContext()
public Boolean get_HasAttributes()
public IEnumerable<OpenXmlAttribute> get_ExtendedAttributes()
public OpenXmlElementList get_ChildElements()
public OpenXmlElement get_Parent()
public String get_NamespaceUri()
public String get_LocalName()
public String get_Prefix()
public IEnumerable<KeyValuePair<StringString>> get_NamespaceDeclarations()
public XmlQualifiedName get_XmlQualifiedName()
public XName get_XName()
public String get_InnerXml()
public String get_OuterXml()
public OpenXmlAttribute GetAttribute(String localName = , String namespaceUri = )
public IList<OpenXmlAttribute> GetAttributes()
public Void SetAttribute(OpenXmlAttribute openXmlAttribute = )
public Void RemoveAttribute(String localName = , String namespaceUri = )
public Void SetAttributes(IEnumerable<OpenXmlAttribute> openXmlAttributes = )
public Void ClearAllAttributes()
public Void AddNamespaceDeclaration(String prefix = , String uri = )
public Void RemoveNamespaceDeclaration(String prefix = )
public T GetFirstChild()
public OpenXmlElement PreviousSibling()
public T PreviousSibling()
public OpenXmlElement NextSibling()
public T NextSibling()
public IEnumerable<OpenXmlElement> Ancestors()
public IEnumerable<T> Ancestors()
public IEnumerable<T> Elements()
public IEnumerable<OpenXmlElement> Elements()
public IEnumerable<T> Descendants()
public IEnumerable<OpenXmlElement> Descendants()
public IEnumerable<OpenXmlElement> ElementsBefore()
public IEnumerable<OpenXmlElement> ElementsAfter()
public Void WriteTo(XmlWriter xmlWriter = )
public Void Append(IEnumerable<OpenXmlElement> newChildren = )
public Void Append(OpenXmlElement[] newChildren = )
public T InsertAfterSelf(T newElement = )
public T InsertBeforeSelf(T newElement = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()

Other methods