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


C# UISprite.MakePixelPerfect方法代码示例

本文整理汇总了C#中UISprite.MakePixelPerfect方法的典型用法代码示例。如果您正苦于以下问题:C# UISprite.MakePixelPerfect方法的具体用法?C# UISprite.MakePixelPerfect怎么用?C# UISprite.MakePixelPerfect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UISprite的用法示例。


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

示例1: SetStarImage

	private void SetStarImage(StarType starType, UISprite spStar)
	{
		string starSpriteName = "fb_xing_yidengdao";
		switch(starType)
		{
            case StarType.StarType1:
		    {
                starSpriteName = "zs";
			
			    spStar.atlas = MogoUIManager.Instance.GetAtlasByIconName(starSpriteName);
			    spStar.spriteName = starSpriteName;
                spStar.MakePixelPerfect();
		    }break;

            case StarType.StarType2:
		    {
                starSpriteName = "hg_h";
			
			    spStar.atlas = MogoUIManager.Instance.GetAtlasByIconName(starSpriteName);
			    spStar.spriteName = starSpriteName;	
			    spStar.MakePixelPerfect();
		    }break;

            case StarType.StarType3:
		    {
			    starSpriteName = "hg";
			
			    spStar.atlas = MogoUIManager.Instance.GetAtlasByIconName(starSpriteName);
			    spStar.spriteName = starSpriteName;	
			    spStar.MakePixelPerfect();
		    }break;
		}		
	}
开发者ID:lbddk,项目名称:ahzs-client,代码行数:33,代码来源:StarLevelInfo.cs

示例2: OnDrawProperties

    /// <summary>
    /// Draw the atlas and sprite selection fields.
    /// </summary>
    protected override bool OnDrawProperties()
    {
        mSprite = mWidget as UISprite;
        ComponentSelector.Draw<UIAtlas>(mSprite.atlas, OnSelectAtlas);
        if (mSprite.atlas == null) return false;

        string spriteName = SpriteField(mSprite.atlas, mSprite.spriteName);

        if (mSprite.spriteName != spriteName)
        {
            Undo.RegisterUndo(mSprite, "Sprite Change");
            mSprite.spriteName = spriteName;
            mSprite.MakePixelPerfect();
            EditorUtility.SetDirty(mSprite.gameObject);
        }
        return true;
    }
开发者ID:quiker,项目名称:hexagon,代码行数:20,代码来源:UISpriteInspector.cs

示例3: PositionSprite

	// Used to position the sprite correctly within the item boundaries. In
	// general this does two things: centers the sprite vertically and adjusts
	// for the sprite padding. Not sure why the latter should be necessary, but...
	// it seems to be.
	Vector3 PositionSprite(Vector3 pos, UISprite sprite, float itemHeight, float scaleX, float scaleY)
	{
		pos.y -= (itemHeight - scaleY) * 0.5f;	// <-- Center sprite vertically.
		
		/* Seems this is no longer needed in NGUI 3.0...
		 *
		UIAtlas.Sprite sp = sprite.GetAtlasSprite();
		float spX = sp.inner.xMin - sp.outer.xMin + sp.paddingLeft * scaleX;
		float spY = sp.inner.yMin - sp.outer.yMin + sp.paddingTop * scaleY;
		
		pos.x -= spX;
		pos.y += spY;
		/**/

		sprite.cachedTransform.localPosition = pos;
		sprite.MakePixelPerfect();
		
		return pos;
	}
开发者ID:Maxii,项目名称:UnityEntry,代码行数:23,代码来源:CtxMenu.cs

示例4: Start

 /// <summary>
 /// Called on during creation
 /// </summary>
 public virtual void Start()
 {
     sprite = this.gameObject.GetComponent<UISprite>();
     sprite.MakePixelPerfect();
 }
开发者ID:hjrhjr,项目名称:Beats2,代码行数:8,代码来源:NoteScript.cs

示例5: AwakeImpl

    protected override void AwakeImpl()
    {
        base.AwakeImpl();

        if ( m_widget != null )
        {
            sprite = m_widget.GetComponent<UISprite>();

            if ( sprite != null )
            {
                sprite.spriteName = m_spriteName;
                sprite.color = m_spriteColor;

                if ( m_AutoSize )
                {
                    sprite.MakePixelPerfect();
                }
            }
        }
    }
开发者ID:aminebenali,项目名称:dancing-cell-code,代码行数:20,代码来源:NvUIImage.cs


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