• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIToolkit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: UIPeaceMakerActor

    //constructor
    public UIPeaceMakerActor(UIToolkit toolkit, string actorName, string fileName)
    {
        //todo make this scalable
        _height = 50; //background image size
        _width = 50;

        _touchFrame = new Rect ( position.x, -position.y, _width, _height );

        //background image is always the same
        _actorBackground = toolkit.addSprite("actorBG.png", 0, 0);
        _actorBackground.parentUIObject = this;
        _actorBackground.positionFromTopLeft (0f, 0f);

        //gradient is always the same
        _actorGradient = toolkit.addSprite ("actor_gradient_white.png", 0, 0);
        _actorGradient.parentUIObject = this;
        _actorGradient.positionFromTopLeft (0f, 0f);

        //image and button
        _theButton = UIButton.create (toolkit, fileName, fileName, 0, 0);
        _theButton.parentUIObject = this;
        _theButton.onTouchUpInside += ( sender ) =>  randomAttitudeTest ();

        //up/down arrow is always the same
        _actorArrow = toolkit.addSprite ("up_arrow_anim_00.png", 0, 0);
        _actorArrow.parentUIObject = this;
        _actorArrow.positionFromTopRight (0f, 0f);

        _arrowUpAnim = _actorArrow.addSpriteAnimation ("arrowUpAnim", 0.1f, "up_arrow_anim_00.png", "up_arrow_anim_01.png", "up_arrow_anim_02.png", "up_arrow_anim_03.png", "up_arrow_anim_04.png", "up_arrow_anim_05.png", "up_arrow_anim_06.png", "up_arrow_anim_07.png", "up_arrow_anim_08.png", "up_arrow_anim_09.png");
        _arrowDownAnim = _actorArrow.addSpriteAnimation ("arrowDownAnim", 0.1f, "down_arrow_anim_00.png", "down_arrow_anim_01.png", "down_arrow_anim_02.png", "down_arrow_anim_03.png", "down_arrow_anim_04.png", "down_arrow_anim_05.png", "down_arrow_anim_06.png", "down_arrow_anim_07.png", "down_arrow_anim_08.png", "down_arrow_anim_09.png");
        _arrowUpAnim.loopReverse = true;
        _arrowDownAnim.loopReverse = true;

        hideAttitudeIndicators ();
    }
开发者ID:hybridsteve,项目名称:dicebaseballapp,代码行数:36,代码来源:UIPeaceMakerActor.cs


示例2: create

    public static UIGhostJoystick create( UIToolkit manager, string joystickFilename, Rect hitArea )
    {
        // create the joystrick sprite
        var joystick = manager.addSprite( joystickFilename, 0, 0, 1, true );

        return new UIGhostJoystick( manager, hitArea, 1, joystick);
    }
开发者ID:hyakugei,项目名称:UIToolkit,代码行数:7,代码来源:UIGhostJoystick.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: 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


示例5: UIAbstractTouchableContainer

	// Default constructor
	public UIAbstractTouchableContainer( UIToolkit manager, UILayoutType layoutType, int spacing ) : base( layoutType )
	{
		_spacing = spacing;
		_manager = manager;
		
		_manager.addToTouchables( this );
	}
开发者ID:githubbar,项目名称:UIToolkit,代码行数:8,代码来源:UIAbstractTouchableContainer.cs


示例6: 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


示例7: create

    public static UITexture create( UIToolkit manager, string filename, int xPos, int yPos, int depth )
    {
        var normalTI = manager.textureInfoForFilename( filename );
        var frame = new Rect( xPos, yPos, normalTI.frame.width, normalTI.frame.height );

        return new UITexture( manager, frame, depth, normalTI.uvRect);
    }
开发者ID:reissgrant,项目名称:UIToolkit,代码行数:7,代码来源:UITexture.cs


示例8: 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


示例9: create

	// 
	public static UIJoystick create( UIToolkit manager, string joystickFilename, Rect hitAreaFrame, float xPos, float yPos )
	{
		// create the joystrick sprite
		var joystick = manager.addSprite( joystickFilename, 0, 0, 1, true );
		
		return new UIJoystick( manager, hitAreaFrame, 1, joystick, xPos, yPos );
	}
开发者ID:n8stowell82,项目名称:UIToolkit,代码行数:8,代码来源:UIJoystick.cs


示例10: UIAbstractTouchableContainer

	// Default constructor
	public UIAbstractTouchableContainer( UIToolkit manager, UILayoutType layoutType, int spacing ) : base( layoutType )
	{
		TOUCH_MAX_DELTA_FOR_ACTIVATION *= UI.scaleFactor;
		_spacing = spacing * UI.scaleFactor;
		_manager = manager;
		
		_manager.addToTouchables( this );
	}
开发者ID:Foxzter,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:9,代码来源:UIAbstractTouchableContainer.cs


示例11: create

	/// <summary>
	/// Creates a swipe detector with no related UI
	/// </summary>
	public static UISwipeDetector create( UIToolkit manager, Rect frame, int depth )
	{
		// create the swipe detector
		var detector = new UISwipeDetector( frame, depth, UIUVRect.zero );
		manager.addTouchableSprite( detector );
		
		return detector;
	}
开发者ID:sidev,项目名称:UIToolkit,代码行数:11,代码来源:UISwipeDetector.cs


示例12: UIBackgroundLayout

	public UIBackgroundLayout( UIToolkit manager, string filename ) : base( UILayoutType.BackgroundLayout ) 
	{
		background = manager.addSprite( filename, 0, 0, 2 );
		addChild( background );
		
		// set dimensions of container based on background texture dimensions
		_width = background.width;
		_height = background.height;
	}
开发者ID:Raj2509,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:9,代码来源:UIBackgroundLayout.cs


示例13: UIAbstractTouchableContainer

	// Default constructor
	public UIAbstractTouchableContainer( UIToolkit manager, UILayoutType layoutType, int spacing ) : base( layoutType )
	{
		_spacing = spacing;
		_manager = manager;
		
		_manager.addToTouchables( this );
		
		// listen to changes to our own transform so we can move the touchFrame
		this.onTransformChanged += transformChanged;
	}
开发者ID:momomo42,项目名称:UIToolkit,代码行数:11,代码来源:UIAbstractTouchableContainer.cs


示例14: 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


示例15: create

	public static UIToggleButton create( UIToolkit manager, string filename, string selectedFilename, string highlightedFilename, int xPos, int yPos )
	{
		var textureInfo = manager.textureInfoForFilename( filename );
		var frame = new Rect( xPos, yPos, textureInfo.frame.width, textureInfo.frame.height );
		
		var selectedTI = manager.textureInfoForFilename( selectedFilename );
		var highlightedTI = manager.textureInfoForFilename( highlightedFilename );
		
		return new UIToggleButton( manager, frame, 1, textureInfo.uvRect, selectedTI.uvRect, highlightedTI.uvRect );
	}
开发者ID:kpro1999,项目名称:UIToolkit,代码行数:10,代码来源:UIToggleButton.cs


示例16: create

    public static UIColorPicker create( UIToolkit manager, string filename, int xPos, int yPos, int depth )
    {
        // grab the texture details for the normal state
        var normalTI = manager.textureInfoForFilename( filename );
        Vector2 textureCoords = new Vector2(normalTI.frame.x, normalTI.frame.y);

        var frame = new Rect( xPos, yPos, normalTI.frame.width, normalTI.frame.height );

        // create the button
        return new UIColorPicker( manager, frame, depth, normalTI.uvRect, textureCoords );
    }
开发者ID:WreckCenter,项目名称:UIToolkit,代码行数:11,代码来源:UIColorPicker.cs


示例17: create

	public static UIProgressBar create( UIToolkit manager, string barFilename, int xPos, int yPos, bool rightToLeft, int depth )
	{
		var textureInfo = manager.textureInfoForFilename( barFilename );
		var frame = new Rect( xPos, yPos, textureInfo.frame.width, textureInfo.frame.height );
		
		if( rightToLeft )
			frame.x = xPos + (int)textureInfo.frame.width;

		var progressBar = new UIProgressBar( manager, frame, depth, textureInfo.uvRect, rightToLeft );
		
		return progressBar;
	}
开发者ID:Foxzter,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:12,代码来源:UIProgressBar.cs


示例18: create

	public static UISlider create( UIToolkit manager, string knobFilename, string trackFilename, int trackxPos, int trackyPos, UISliderLayout layout, int depth = 2, bool knobInFront = true )
	{
		// create the track first so we can use its dimensions to position the knob		
		var trackTI = manager.textureInfoForFilename( trackFilename );
		var trackFrame = new Rect( trackxPos, trackyPos, trackTI.frame.width, trackTI.frame.height );

		// create a knob using our cacluated position
		var knobDepth = knobInFront ? depth - 1 : depth + 1;
		var knob = manager.addSprite( knobFilename, trackxPos, trackyPos, knobDepth, true );
		
		return new UISlider( manager, trackFrame, depth, trackTI.uvRect, knob, layout );
	}
开发者ID:Foxzter,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:12,代码来源:UISlider.cs


示例19: create

    public static new UIContinuousButton create( UIToolkit manager, string filename, string highlightedFilename, int xPos, int yPos, int depth )
    {
        // grab the texture details for the normal state
        var normalTI = manager.textureInfoForFilename( filename );
        var frame = new Rect( xPos, yPos, normalTI.frame.width, normalTI.frame.height );

        // get the highlighted state
        var highlightedTI = manager.textureInfoForFilename( highlightedFilename );

        // create the button
        return new UIContinuousButton( manager, frame, depth, normalTI.uvRect, highlightedTI.uvRect );
    }
开发者ID:hyakugei,项目名称:UIToolkit,代码行数:12,代码来源:UIContinuousButton.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UITouch类代码示例发布时间:2022-05-24
下一篇:
C# UIToolbar类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap