本文整理汇总了C#中UIToolkit.addTouchableSprite方法的典型用法代码示例。如果您正苦于以下问题:C# UIToolkit.addTouchableSprite方法的具体用法?C# UIToolkit.addTouchableSprite怎么用?C# UIToolkit.addTouchableSprite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIToolkit
的用法示例。
在下文中一共展示了UIToolkit.addTouchableSprite方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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 );
}
示例2: 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;
}
示例3: 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 );
}
示例4: 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 );
}
示例5: 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 );
}
示例6: UIGhostJoystick
private UIToolkit _manager; // we need this for getting at texture details after the constructor
#endregion Fields
#region Constructors
public UIGhostJoystick( UIToolkit manager, Rect frame, int depth, UISprite joystickSprite)
: base(frame, depth, UIUVRect.zero)
{
// Save out the uvFrame for the sprite so we can highlight
_tempUVframe = joystickSprite.uvFrame;
// Save the joystickSprite and make it a child of the us for organization purposes
_joystickSprite = joystickSprite;
_joystickSprite.parentUIObject = this;
resetJoystick();
manager.addTouchableSprite( this );
_manager = manager;
}
示例7: 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;
}
示例8: UISlice9
/// <summary>
/// Initializes a new instance of the <see cref="UISlice9"/> class.
/// </summary>
/// <param name='manager'>
/// Manager.
/// </param>
/// <param name='frame'>
/// Frame.
/// </param>
/// <param name='depth'>
/// Depth.
/// </param>
/// <param name='uvFrame'>
/// Uv frame.
/// </param>
/// <param name='highlightedUVframe'>
/// Highlighted U vframe.
/// </param>
/// <param name='width'>
/// Final width
/// </param>
/// <param name='height'>
/// Final height
/// </param>
/// <param name='sTP'>
/// Top Margin
/// </param>
/// <param name='sRT'>
/// Right Margin
/// </param>
/// <param name='sBT'>
/// Bottom Margin
/// </param>
/// <param name='sLT'>
/// Left Margin
/// </param>
public UISlice9( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UIUVRect highlightedUVframe, int width, int height, int sTP, int sRT, int sBT, int sLT ):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;
int stretchedWidth = width - ( sLT + sRT );
int stretchedHeight = height - ( sTP + sBT );
this.manager = manager;
// Top Left
spriteSlices[0] = new UISprite( new Rect( frame.x, frame.y, sLT, sTP ), depth, new UIUVRect( uvFrame.frame.x, uvFrame.frame.y, sLT, sTP, manager.textureSize ) );
spriteSlices[0].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[0] );
// Top Middle
spriteSlices[1] = new UISprite( new Rect( frame.x + sLT, frame.y, stretchedWidth, sTP ), depth, new UIUVRect( uvFrame.frame.x + sLT, uvFrame.frame.y, uvFrame.frame.width - ( sRT + sLT ), sTP, manager.textureSize ) );
spriteSlices[1].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[1] );
// Top Right
spriteSlices[2] = new UISprite( new Rect( frame.x + sLT + stretchedWidth, frame.y, sRT, sTP ), depth, new UIUVRect( uvFrame.frame.x + sLT + ( uvFrame.frame.width - ( sRT + sLT ) ), uvFrame.frame.y, sRT, sTP, manager.textureSize ) );
spriteSlices[2].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[2] );
// Middle Left
spriteSlices[3] = new UISprite( new Rect( frame.x, frame.y + sTP, sLT, stretchedHeight ), depth, new UIUVRect( uvFrame.frame.x, uvFrame.frame.y + sTP, sLT, uvFrame.frame.height - ( sTP + sBT ), manager.textureSize ) );
spriteSlices[3].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[3] );
// Middle Middle
spriteSlices[4] = new UISprite( new Rect( frame.x + sLT, frame.y + sTP, stretchedWidth, stretchedHeight ), depth, new UIUVRect( uvFrame.frame.x + sLT, uvFrame.frame.y + sTP, uvFrame.frame.height - ( sTP + sBT ), (int)frame.width - ( sLT + sRT ), manager.textureSize ) );
spriteSlices[4].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[4] );
// Middle Right
spriteSlices[5] = new UISprite( new Rect( frame.x + sLT + stretchedWidth, frame.y + sTP, sRT, stretchedHeight ), depth, new UIUVRect( uvFrame.frame.x + ( uvFrame.frame.width - sRT ), uvFrame.frame.y + sTP, sRT, uvFrame.frame.height - ( sBT + sTP ), manager.textureSize ) );
spriteSlices[5].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[5] );
// Bottom Left
spriteSlices[6] = new UISprite( new Rect( frame.x, frame.y + sTP + stretchedHeight, sLT, sBT ), depth, new UIUVRect( uvFrame.frame.x, uvFrame.frame.y + ( uvFrame.frame.height - sBT ), sLT, sBT, manager.textureSize ) );
spriteSlices[6].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[6] );
// Bottom Middle
spriteSlices[7] = new UISprite( new Rect( frame.x + sLT, frame.y + sTP + stretchedHeight, stretchedWidth, sBT ), depth, new UIUVRect( uvFrame.frame.x + sLT, uvFrame.frame.y + ( uvFrame.frame.height - sBT ), uvFrame.frame.width - ( sLT + sRT ), sBT, manager.textureSize ) );
spriteSlices[7].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[7] );
// Bottom Right
spriteSlices[8] = new UISprite( new Rect( frame.x + sLT + stretchedWidth, frame.y + sTP + stretchedHeight, sRT, sBT ), depth, new UIUVRect( uvFrame.frame.x + sLT + ( uvFrame.frame.width - ( sRT + sLT ) ), uvFrame.frame.y + ( uvFrame.frame.height - sBT ), sRT, sBT, manager.textureSize ) );
spriteSlices[8].client.transform.parent = this.client.transform;
manager.addSprite( spriteSlices[8] );
this.setSize( width, height );
manager.addTouchableSprite( this );
}