本文整理汇总了C#中UIToolkit类的典型用法代码示例。如果您正苦于以下问题:C# UIToolkit类的具体用法?C# UIToolkit怎么用?C# UIToolkit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIToolkit类属于命名空间,在下文中一共展示了UIToolkit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 ();
}
示例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);
}
示例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 );
}
示例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 );
}
示例5: UIAbstractTouchableContainer
// Default constructor
public UIAbstractTouchableContainer( UIToolkit manager, UILayoutType layoutType, int spacing ) : base( layoutType )
{
_spacing = spacing;
_manager = manager;
_manager.addToTouchables( this );
}
示例6: UITexture
public UITexture( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame)
: base(frame, depth, uvFrame)
{
_normalUVframe = uvFrame;
manager.addSprite( this );
}
示例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);
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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;
}
示例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;
}
示例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;
}
示例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 );
}
示例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 );
}