本文整理汇总了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 );
}
示例2: UITexture
public UITexture( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame)
: base(frame, depth, uvFrame)
{
_normalUVframe = uvFrame;
manager.addSprite( this );
}
示例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: 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 );
}
示例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 );
}
示例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;
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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;
}
示例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 );
}
示例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 );
}
示例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;
}
示例14: UIContinuousButton
public UIContinuousButton( UIToolkit manager, Rect frame, int depth, UIUVRect uvFrame, UIUVRect highlightedUVframe )
: base(manager, frame, depth, uvFrame, highlightedUVframe)
{
}
示例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;
}