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


C# UIUVRect类代码示例

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


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

示例1: UIProgressBar

    public UIProgressBar( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UISprite bar, bool rotated )
        : base(frame, depth, uvFrame, rotated)
    {
        // Save the bar and make it a child of the container/border for organization purposes
        _bar = bar;
        _bar.parentUIObject = this;

        _barOriginalWidth = _bar.width;
        _barOriginalHeight = _bar.height;

        /*
        // Save the bars original size
        if (rotated)
        {
            _barOriginalWidth = _bar.width;
            _barOriginalHeight = _bar.height;
        }
        else
        {
            _barOriginalWidth = _bar.width;
            _barOriginalHeight = _bar.height;
        }
        */

        /*if (!_rotated)
                    normalFrame = new Rect( clientTransform.position.x, -clientTransform.position.y, width * touchesScale.x, height * touchesScale.y);
                else
                    normalFrame = new Rect( clientTransform.position.x, -clientTransform.position.y - (width * touchesScale.y), height * touchesScale.x, width * touchesScale.y);
                    */
        _barOriginalUVframe = _bar.uvFrame;

        manager.addSprite( this );
    }
开发者ID:EskemaGames,项目名称:UIToolkit,代码行数:33,代码来源:UIProgressBar.cs

示例2: UITexture

    public UITexture( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame)
        : base(frame, depth, uvFrame)
    {
        _normalUVframe = uvFrame;

        manager.addSprite( this );
    }
开发者ID:reissgrant,项目名称:UIToolkit,代码行数:7,代码来源:UITexture.cs

示例3: UIColorPicker

 public UIColorPicker( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, Vector2 textureCoords )
     : base(frame, depth, uvFrame)
 {
     //We store the coordinates of the top left of the subtexture
     this.textureCoords = textureCoords;
     manager.addTouchableSprite( this );
 }
开发者ID:WreckCenter,项目名称:UIToolkit,代码行数:7,代码来源:UIColorPicker.cs

示例4: UIZoomButton

	public UIZoomButton( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UIUVRect highlightedUVframe ):base( manager, frame, depth, uvFrame, highlightedUVframe )
	{
		centerize();
		autoRefreshPositionOnScaling = false;
		_zoomInAnimation = new UIAnimation( this, 0.3f, UIAnimationProperty.Scale, new Vector3( 1, 1, 1 ), new Vector3( 1.3f, 1.3f, 1.3f ), Easing.Quartic.easeInOut );
		_zoomOutAnimation = new UIAnimation( this, 0.3f, UIAnimationProperty.Scale, new Vector3( 1.3f, 1.3f, 1.3f ), new Vector3( 1, 1, 1 ), Easing.Quartic.easeInOut );
	}
开发者ID:Raj2509,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:7,代码来源:UIZoomButton.cs

示例5: UIButton

	public UIButton( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UIUVRect highlightedUVframe ):base( frame, depth, uvFrame )
	{
		// If a highlighted frame has not yet been set use the normalUVframe
		if( highlightedUVframe == UIUVRect.zero )
			highlightedUVframe = uvFrame;
		
		this.highlightedUVframe = highlightedUVframe;
		
		manager.addTouchableSprite( this );
	}
开发者ID:Gelatos,项目名称:TabletopHelper,代码行数:10,代码来源:UIButton.cs

示例6: create

	/*
	public static UIControlTemplate create( string filename, string highlightedFilename, int xPos, int yPos, int depth = 1 )
	{
		// create and return a new UIControlTemplate
	}
	*/

	public UIControlTemplate( Rect frame, int depth, UIUVRect uvFrame, UIUVRect highlightedUVframe ):base( frame, depth, uvFrame )
	{
		// Save a copy of our uvFrame here so that when highlighting turns off we have the original UVs
		_tempUVframe = uvFrame;
		
		// If a highlighted frame has not yet been set use the normalUVframe
		if( highlightedUVframe == UIUVRect.zero )
			highlightedUVframe = uvFrame;
		
		this.highlightedUVframe = highlightedUVframe;
	}
开发者ID:Foxzter,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:18,代码来源:UIControlTemplate.cs

示例7: UISlider

	public UISlider( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UISprite sliderKnob, UISliderLayout layout, bool rotated ):base( frame, depth, uvFrame, rotated )
	{
		this.layout = layout;
		
		// save the sliderKnob and make it a child of the slider for organization purposes
		_sliderKnob = sliderKnob;
		_sliderKnob.parentUIObject = this;
		
		// setup the min/max position values for the sliderKnob
		updateSliderKnobConstraints();
		
		manager.addTouchableSprite( this );
	}
开发者ID:EskemaGames,项目名称:UIToolkit,代码行数:13,代码来源:UISlider.cs

示例8: UIButton

	public UIButton( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UIUVRect highlightedUVframe ):base( frame, depth, uvFrame )
	{
		// Save a copy of our uvFrame here so that when highlighting turns off we have the original UVs
		_normalUVframe = uvFrame;
		
		// If a highlighted frame has not yet been set use the normalUVframe
		if( highlightedUVframe == UIUVRect.zero )
			highlightedUVframe = uvFrame;
		
		this.highlightedUVframe = highlightedUVframe;
		
		manager.addTouchableSprite( this );
	}
开发者ID:reissgrant,项目名称:UIToolkit,代码行数:13,代码来源:UIButton.cs

示例9: UIProgressBar

    public UIProgressBar( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UISprite bar )
        : base(frame, depth, uvFrame)
    {
        // Save the bar and make it a child of the container/border for organization purposes
        _bar = bar;
        _bar.parentUIObject = this;

        // Save the bars original size
        _barOriginalWidth = _bar.width;
        _barOriginalUVframe = _bar.uvFrame;

        manager.addSprite( this );
    }
开发者ID:nsxdavid,项目名称:UIToolkit,代码行数:13,代码来源:UIProgressBar.cs

示例10: UISprite

    public UISprite( Rect frame, int depth, UIUVRect uvFrame, bool gameObjectOriginInCenter ) : base()
    {
		this.gameObjectOriginInCenter = gameObjectOriginInCenter;
		
		// Setup our GO
		client.transform.position = new Vector3( frame.x, -frame.y, depth ); // Depth will affect z-index
		
		// Save these for later.  The manager will call initializeSize() when the UV's get setup
		_width = frame.width;
		_height = frame.height;
		
		_uvFrame = uvFrame;
    }
开发者ID:Gelatos,项目名称:TabletopHelper,代码行数:13,代码来源:UISprite.cs

示例11: UIProgressBar

	public UIProgressBar( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, bool rightToLeft ):base( frame, depth, uvFrame )
	{
		manager.addSprite( this );
		
		// Save the bars original size
		_barOriginalWidth = frame.width;
		_barOriginalUVframe = uvFrame;
		this.rightToLeft = rightToLeft;

		// Update the bar size based on the value
		if( rightToLeft )
			setSize( _value * -_barOriginalWidth, frame.height );
		else
			setSize( _value * _barOriginalWidth, frame.height );
	}
开发者ID:Foxzter,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:15,代码来源:UIProgressBar.cs

示例12: UIProgressBar

    public UIProgressBar( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UISprite bar )
        : base(frame, depth, uvFrame)
    {
        // Save the bar and make it a child of the container/border for organization purposes
        _bar = bar;
        _bar.parentUIObject = this;

        // Save the bars original size
        _barOriginalWidth = _bar.width;
        _barOriginalUVframe = _bar.uvFrame;

        // Update the bar size based on the value
        if (rightToLeft)
            _bar.setSize(_value * -_barOriginalWidth, _bar.height);
        else
            _bar.setSize(_value * _barOriginalWidth, _bar.height);

        manager.addSprite( this );
    }
开发者ID:githubbar,项目名称:UIToolkit,代码行数:19,代码来源:UIProgressBar.cs

示例13: UIJoystick

	public UIJoystick( UIToolkit manager, Rect frame, int depth, UISprite joystickSprite, float xPos, float yPos ):base( frame, depth, UIUVRect.zero )
	{
		// Save out the uvFrame for the sprite so we can highlight
		_normalUVframe = joystickSprite.uvFrame;
		
		// Save the joystickSprite and make it a child of the us for organization purposes
		_joystickSprite = joystickSprite;
		_joystickSprite.parentUIObject = this;
		
		// Move the joystick to its default position after converting the offset to a vector3
		_joystickOffset = new Vector3( xPos, yPos );
		
		// Set the maxMovement which will in turn calculate the _joystickBoundary
		this.maxJoystickMovement = _maxJoystickMovement;
		
		resetJoystick();
		
		manager.addTouchableSprite( this );
		_manager = manager;
	}
开发者ID:ddasin,项目名称:UIToolkit,代码行数:20,代码来源:UIJoystick.cs

示例14: UIContinuousButton

 public UIContinuousButton( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UIUVRect highlightedUVframe )
     : base(manager, frame, depth, uvFrame, highlightedUVframe)
 {
 }
开发者ID:hyakugei,项目名称:UIToolkit,代码行数:4,代码来源:UIContinuousButton.cs

示例15: drawText

    /// <summary>
    /// Draw text on screen, create each quad and send it to the manager
    /// </summary>
    private int drawText( string text, float xPos, float yPos, float scale, int depth, Color color )
    {
        float dx = xPos;
        float dy = 0;
        float textWidth;
        float offsetY;

        int fontLineSkip = 0;

        int charId = 0;

        UISprite[] sprites = null;

        int length = text.Length;
        sprites = new UISprite[length];

        for( var i = 0; i < text.Length; i++ )
        {
            charId = System.Convert.ToInt32( text[i] );

            // "10" is the new line char
            if( charId == 10 )
            {
                // calculate the size to center text on Y axis, based on its scale
                // 77 is the "M" char usually big enough to get a proper spaced
                // lineskip, use any other char if you want
                fontLineSkip += (int)( _fontDetails[77].h * scale * lineSpacing );
                dx = xPos;
            }
            else
            {
                // calculate the size to center text on Y axis, based on its scale
                offsetY = _fontDetails[charId].offsety * scale;
                dy =  yPos + offsetY + fontLineSkip;
            }

            // add quads for each char
            var uvRect = new UIUVRect( (int)_textureOffset.x + _fontDetails[charId].posX, (int)_textureOffset.y + _fontDetails[charId].posY, _fontDetails[charId].w, _fontDetails[charId].h, _manager.textureSize );
            sprites[i] = new UISprite( new Rect( dx, dy, _fontDetails[charId].w * scale, _fontDetails[charId].h * scale ), depth, uvRect, false );
            _manager.addSprite( sprites[i] );
            sprites[i].color = color;

            // calculate the size to advance, based on its scale
            textWidth = _fontDetails[charId].xadvance * scale;

            // advance the position to draw the next letter
            dx += textWidth + _fontDetails[charId].offsetx;
        }

        // add all sprites at once to the array, we use this later to delete the strings
        _textSprites.Add( sprites );

        return _textSprites.Count - 1;
    }
开发者ID:TaintedLemon,项目名称:UIToolkit,代码行数:57,代码来源:UIText.cs


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