本文整理汇总了C#中UIToolkit.textureInfoForFilename方法的典型用法代码示例。如果您正苦于以下问题:C# UIToolkit.textureInfoForFilename方法的具体用法?C# UIToolkit.textureInfoForFilename怎么用?C# UIToolkit.textureInfoForFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIToolkit
的用法示例。
在下文中一共展示了UIToolkit.textureInfoForFilename方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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 );
}
示例2: 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 );
}
示例3: 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);
}
示例4: UIVerticalPanel
public UIVerticalPanel( UIToolkit manager, string topFilename, string middleFilename, string bottomFilename ) : base( UILayoutType.Vertical )
{
var texInfo = manager.textureInfoForFilename( topFilename );
_topStrip = manager.addSprite( topFilename, 0, 0, 5 );
_topStrip.parentUIObject = this;
_topStripHeight = (int)texInfo.frame.height;
_width = texInfo.frame.width;
// we overlap the topStrip 1 pixel to ensure we get a good blend here
_middleStrip = manager.addSprite( middleFilename, 0, _topStripHeight , 5 );
_middleStrip.parentUIObject = this;
texInfo = manager.textureInfoForFilename( middleFilename );
_bottomStrip = manager.addSprite( bottomFilename, 0, 0, 5 );
_bottomStrip.parentUIObject = this;
_bottomStripHeight = (int)texInfo.frame.height;
}
示例5: create
public static UIStateButton create( UIToolkit manager, string[] filenames, string[] highlightedFilenames, int xPos, int yPos, int depth )
{
// grab the texture details for the initial state
var firstNormalTI = manager.textureInfoForFilename( filenames[0] );
var frame = new Rect( xPos, yPos, firstNormalTI.frame.width, firstNormalTI.frame.height );
// get the initial highlighted state
var firstHighlightedTI = firstNormalTI;
if (highlightedFilenames.Length > 0) {
manager.textureInfoForFilename( highlightedFilenames[0] );
}
var button = new UIStateButton( manager, frame, depth, firstNormalTI.uvRect, firstHighlightedTI.uvRect );
button.addFrames(filenames, highlightedFilenames);
return button;
}
示例6: 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 );
}
示例7: create
/// <summary>
/// Creates a swipe detector with a texture backing the hit area
/// </summary>
public static UISwipeDetector create( UIToolkit manager, string filename, int xPos, int yPos, int depth )
{
// grab the texture details
var normalTI = manager.textureInfoForFilename( filename );
var frame = new Rect( xPos, yPos, normalTI.frame.width, normalTI.frame.height );
// create the swipe detector
var detector = new UISwipeDetector( frame, depth, normalTI.uvRect );
manager.addTouchableSprite( detector );
return detector;
}
示例8: 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 );
}
示例9: 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;
}
示例10: UIVerticalPanel
public UIVerticalPanel( UIToolkit manager, string topFilename, string middleFilename, string bottomFilename )
: base(UILayoutType.Vertical)
{
var texInfo = manager.textureInfoForFilename( topFilename );
_topStrip = manager.addSprite( topFilename, 0, 0, 5 );
_topStrip.parentUIObject = this;
_topStripHeight = (int)texInfo.frame.height;
_width = texInfo.frame.width;
// we overlap the topStrip 1 pixel to ensure we get a good blend here
_middleStrip = manager.addSprite( middleFilename, 0, _topStripHeight , 5 );
_middleStrip.parentUIObject = this;
texInfo = manager.textureInfoForFilename( middleFilename );
_bottomStrip = manager.addSprite( bottomFilename, 0, 0, 5 );
_bottomStrip.parentUIObject = this;
_bottomStripHeight = (int)texInfo.frame.height;
// HACK: Gabo edit. Adding the sprites uiChildArray so they can be deleted
addUIChild( _topStrip, _middleStrip, _bottomStrip );
}
示例11: create
public static UIStateSprite create(UIToolkit manager, string[] filenames, int xPos, int yPos, int depth)
{
// Grab the texture details for the initial state
UITextureInfo firstNormalTI = manager.textureInfoForFilename(filenames[0]);
Rect frame = new Rect(xPos, yPos, firstNormalTI.frame.width, firstNormalTI.frame.height);
// create the button
UIStateSprite sprite = new UIStateSprite(manager, frame, depth, firstNormalTI.uvRect);
// Add frames
sprite.addFrames(filenames);
return sprite;
}
示例12: create
public static UISlider create( UIToolkit manager, string knobFilename, string trackFilename, int trackxPos, int trackyPos, UISliderLayout layout )
{
// 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 );
// position the knob based on the knobs size, layout and the track size
if( layout == UISliderLayout.Horizontal )
trackyPos += (int)trackTI.frame.height / 2;
else
trackxPos += (int)trackTI.frame.width / 2;
// create a knob using our cacluated position
var knob = manager.addSprite( knobFilename, trackxPos, trackyPos, 1, true );
return new UISlider( manager, trackFrame, 2, trackTI.uvRect, knob, layout, trackTI.rotated );
}
示例13: UIText
public UIText( UIToolkit manager, string fontFilename, string textureFilename )
{
_manager = manager;
_fontDetails = new UIFontCharInfo[256];
for( int i = 0; i < _fontDetails.Length; i++ )
_fontDetails[i] = new UIFontCharInfo();
loadConfigfile( fontFilename );
// grab the texture offset from the UI
var rect = _manager.frameForFilename( textureFilename );
// Since the font config data adjusts for padding, but TexturePacker trimming removes it,
// We need to sub out the trimmed amount coming back from the manager.
var info = _manager.textureInfoForFilename( textureFilename );
this._textureOffset = new Vector2( rect.x - info.sourceSize.x, rect.y - info.sourceSize.y );
}
示例14: create
// the bars x/y coordinates should be relative to the borders
public static UIProgressBar create( UIToolkit manager, string barFilename, string borderFilename, int barxPos, int baryPos, int borderxPos, int borderyPos, bool rightToLeft, int depth, bool barInFront = true )
{
var borderTI = manager.textureInfoForFilename( borderFilename );
var borderFrame = new Rect( borderxPos, borderyPos, borderTI.frame.width, borderTI.frame.height );
UISprite bar;
if( rightToLeft )
bar = manager.addSprite( barFilename, borderxPos - barxPos + ((int)borderTI.frame.width), borderyPos + baryPos, depth );
else
bar = manager.addSprite( barFilename, borderxPos + barxPos, borderyPos + baryPos, depth );
var barDepth = barInFront ? depth - 1 : depth + 1;
var progressBar = new UIProgressBar( manager, borderFrame, barDepth, borderTI.uvRect, bar );
progressBar.rightToLeft = rightToLeft;
return progressBar;
}
示例15: create
/// <summary>
/// Create a Slice-9 touchable sprite
/// </summary>
/// <param name='manager'>
/// Manager.
/// </param>
/// <param name='filename'>
/// Filename.
/// </param>
/// <param name='highlightedFilename'>
/// Highlighted filename.
/// </param>
/// <param name='xPos'>
/// X position.
/// </param>
/// <param name='yPos'>
/// Y position.
/// </param>
/// <param name='width'>
/// Width.
/// </param>
/// <param name='height'>
/// 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 static UISlice9 create( UIToolkit manager, string filename, string highlightedFilename, int xPos, int yPos, int width, int height, int sTP, int sRT, int sBT, int sLT, 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 UISlice9( manager, frame, depth, normalTI.uvRect, highlightedTI.uvRect, width, height, sTP, sRT, sBT, sLT );
}