当前位置: 首页>>代码示例>>C#>>正文


C# Overflow类代码示例

本文整理汇总了C#中Overflow的典型用法代码示例。如果您正苦于以下问题:C# Overflow类的具体用法?C# Overflow怎么用?C# Overflow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Overflow类属于命名空间,在下文中一共展示了Overflow类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnAnchor

    /// <summary>
    /// If the label is anchored it should not auto-resize.
    /// </summary>

    protected override void OnAnchor() {
        if (mOverflow == Overflow.ResizeFreely) {
            if (isFullyAnchored)
                mOverflow = Overflow.ShrinkContent;
        }
        else if (mOverflow == Overflow.ResizeHeight) {
            if (topAnchor.target != null && bottomAnchor.target != null)
                mOverflow = Overflow.ShrinkContent;
        }
        base.OnAnchor();
    }
开发者ID:Star-Counters,项目名称:Star-Counters,代码行数:15,代码来源:UILabel.cs

示例2: MakePixelPerfect

	/// <summary>
	/// Text is pixel-perfect when its scale matches the size.
	/// </summary>

	public override void MakePixelPerfect ()
	{
		if (bitmapFont != null)
		{
			float pixelSize = (bitmapFont != null) ? bitmapFont.pixelSize : 1f;

			Vector3 pos = cachedTransform.localPosition;
			pos.x = Mathf.RoundToInt(pos.x);
			pos.y = Mathf.RoundToInt(pos.y);
			pos.z = Mathf.RoundToInt(pos.z);

			cachedTransform.localPosition = pos;
			cachedTransform.localScale = Vector3.one;

			if (mOverflow == Overflow.ResizeFreely)
			{
				AssumeNaturalSize();
			}
			else
			{
				Overflow over = mOverflow;
				mOverflow = Overflow.ShrinkContent;
				ProcessText(false);
				mOverflow = over;

				int minX = Mathf.RoundToInt(mCalculatedSize.x * pixelSize);
				int minY = Mathf.RoundToInt(mCalculatedSize.y * pixelSize);

				if (width < minX) width = minX;
				if (height < minY) height = minY;
			}
		}
		else base.MakePixelPerfect();
	}
开发者ID:Boerlam001,项目名称:DungeonGrind,代码行数:38,代码来源:UILabel.cs

示例3: MakePixelPerfect

    /// <summary>
    /// Text is pixel-perfect when its scale matches the size.
    /// </summary>

    public override void MakePixelPerfect() {
        if (ambigiousFont != null) {
            Vector3 pos = cachedTransform.localPosition;
            pos.x = Mathf.RoundToInt(pos.x);
            pos.y = Mathf.RoundToInt(pos.y);
            pos.z = Mathf.RoundToInt(pos.z);

            cachedTransform.localPosition = pos;
            cachedTransform.localScale = Vector3.one;

            if (mOverflow == Overflow.ResizeFreely) {
                AssumeNaturalSize();
            }
            else {
                int w = width;
                int h = height;

                Overflow over = mOverflow;
                if (over != Overflow.ResizeHeight) mWidth = 100000;
                mHeight = 100000;

                mOverflow = Overflow.ShrinkContent;
                ProcessText(false, true);
                mOverflow = over;

                int minX = Mathf.RoundToInt(mCalculatedSize.x);
                int minY = Mathf.RoundToInt(mCalculatedSize.y);

                minX = Mathf.Max(minX, base.minWidth);
                minY = Mathf.Max(minY, base.minHeight);

                if ((minX & 1) == 1) ++minX;
                if ((minY & 1) == 1) ++minY;

                mWidth = Mathf.Max(w, minX);
                mHeight = Mathf.Max(h, minY);

                MarkAsChanged();
            }
        }
        else base.MakePixelPerfect();
    }
开发者ID:Star-Counters,项目名称:Star-Counters,代码行数:46,代码来源:UILabel.cs

示例4: MakePixelPerfect

 public override void MakePixelPerfect()
 {
     if (this.ambigiousFont != null)
     {
         float num = (this.bitmapFont == null) ? 1f : this.bitmapFont.pixelSize;
         Vector3 localPosition = base.cachedTransform.localPosition;
         localPosition.x = Mathf.RoundToInt(localPosition.x);
         localPosition.y = Mathf.RoundToInt(localPosition.y);
         localPosition.z = Mathf.RoundToInt(localPosition.z);
         base.cachedTransform.localPosition = localPosition;
         base.cachedTransform.localScale = Vector3.one;
         if (this.mOverflow == Overflow.ResizeFreely)
         {
             this.AssumeNaturalSize();
         }
         else
         {
             Overflow mOverflow = this.mOverflow;
             this.mOverflow = Overflow.ShrinkContent;
             this.ProcessText(false);
             this.mOverflow = mOverflow;
             int num2 = Mathf.RoundToInt(this.mCalculatedSize.x * num);
             int num3 = Mathf.RoundToInt(this.mCalculatedSize.y * num);
             if (this.bitmapFont != null)
             {
                 int[] values = new int[] { this.bitmapFont.defaultSize };
                 num2 = Mathf.Max(values);
                 int[] numArray2 = new int[] { this.bitmapFont.defaultSize };
                 num3 = Mathf.Max(numArray2);
             }
             else
             {
                 int[] numArray3 = new int[] { base.minWidth };
                 num2 = Mathf.Max(numArray3);
                 int[] numArray4 = new int[] { base.minHeight };
                 num3 = Mathf.Max(numArray4);
             }
             if (base.width < num2)
             {
                 base.width = num2;
             }
             if (base.height < num3)
             {
                 base.height = num3;
             }
         }
     }
     else
     {
         base.MakePixelPerfect();
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:52,代码来源:UILabel.cs

示例5: SetOverflowXY

 /// <summary>
 /// Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing undefined will preserve the current value.
 /// </summary>
 /// <param name="overflowX">The overflow-x value.</param>
 /// <param name="overflowY">The overflow-y value.</param>
 public void SetOverflowXY(Overflow overflowX, Overflow overflowY)
 {
     this.Call("setOverflowXY", overflowX.ToString().ToLowerInvariant(), overflowY.ToString().ToLowerInvariant());
 }
开发者ID:emayk,项目名称:Ext.NET.Pro,代码行数:9,代码来源:ComponentBase.cs

示例6: Clone

            public ushort Index; // Insert this cell before idx-th non-overflow cell

            #endregion Fields

            #region Methods

            public Overflow Clone()
            {
                var cp = new Overflow();
                if (Cell != null)
                {
                    cp.Cell = MallocEx.sqlite3Malloc(Cell.Length);
                    Buffer.BlockCopy(Cell, 0, cp.Cell, 0, Cell.Length);
                }
                cp.Index = Index;
                return cp;
            }
开发者ID:JiujiangZhu,项目名称:feaserver,代码行数:17,代码来源:MemPage.cs

示例7: OnGUI

    private void OnGUI()
    {
        userManual = GUILayout.TextArea(userManual, "Label");

        EditorGUILayout.Space();

        EditorGUILayout.LabelField("FontType:");
        EditorGUILayout.Space();
        EditorGUILayout.BeginHorizontal();
        fontType = (FontType)EditorGUILayout.EnumPopup(fontType);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Space();

        if (fontType == FontType.Unity)
        {
            unityFont = (Font)EditorGUILayout.ObjectField("UnityFont", unityFont, typeof(Font), false);
        }

        if (fontType == FontType.NGUI)
        {

            var fontObject = EditorGUILayout.ObjectField("NGUIFont", nguiFont, typeof(GameObject), false) as GameObject;
            if (fontObject != null)
            {
                nguiFont = fontObject.GetComponent<UIFont>();
            }

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Overflow:");
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            overflow = (Overflow)EditorGUILayout.EnumPopup(overflow);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Crisp:");
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            crisp = (Crisp)EditorGUILayout.EnumPopup(crisp);
            EditorGUILayout.EndHorizontal();
        }

        EditorGUILayout.Space();

        var validated = Validate();
        GUI.enabled = validated;
        if (GUILayout.Button("ApplyFont"))
        {
            ApplyFont();
        }
        GUI.enabled = true;
    }
开发者ID:wuxin0602,项目名称:Nothing,代码行数:55,代码来源:SwitchFontEditorWindow.cs

示例8: OnAnchor

	/// <summary>
	/// If the label is anchored it should not auto-resize.
	/// </summary>

	protected override void OnAnchor ()
	{
		if (mOverflow == Overflow.ResizeFreely || mOverflow == Overflow.ResizeHeight)
			mOverflow = Overflow.ShrinkContent;
		base.OnAnchor();
	}
开发者ID:Azazell0,项目名称:AllMinigames,代码行数:10,代码来源:UILabel.cs


注:本文中的Overflow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。