本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.Texture2D.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Texture2D.Equals方法的具体用法?C# Texture2D.Equals怎么用?C# Texture2D.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.Texture2D
的用法示例。
在下文中一共展示了Texture2D.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawModernButton
private static void drawModernButton(int myID, int x, int y, int width, int height, string text,
Color? selectedColor, Texture2D tex)
{
var num1 = width > 65 ? 13 : 0;
if (!selectedColor.HasValue)
selectedColor = GuiData.Default_Trans_Grey_Strong;
var destinationRectangle = GuiData.tmpRect;
destinationRectangle.X = x;
destinationRectangle.Y = y;
destinationRectangle.Width = width;
destinationRectangle.Height = height;
if (tex.Equals(Utils.white))
{
if (!outlineOnly)
{
GuiData.spriteBatch.Draw(Utils.white, destinationRectangle,
GuiData.hot == myID
? (GuiData.active == myID
? GuiData.Default_Trans_Grey_Dark
: GuiData.Default_Trans_Grey_Bright)
: GuiData.Default_Trans_Grey);
destinationRectangle.Width = num1;
GuiData.spriteBatch.Draw(Utils.white, destinationRectangle, selectedColor.Value);
}
RenderedRectangle.doRectangleOutline(x, y, width, height, 1,
outlineOnly ? selectedColor : GuiData.Default_Trans_Grey_Solid);
}
else
GuiData.spriteBatch.Draw(tex, destinationRectangle,
GuiData.hot == myID
? (GuiData.active == myID ? GuiData.Default_Unselected_Color : GuiData.Default_Lit_Backing_Color)
: selectedColor.Value);
var spriteFont = smallButtonDraw ? GuiData.detailfont : GuiData.tinyfont;
var scale = spriteFont.MeasureString(text);
var num2 = scale.Y;
scale.X = scale.X <= (double) (width - 4) ? 1f : (width - (4 + num1 + 5))/scale.X;
scale.Y = scale.Y <= (double) height ? 1f : height/scale.Y;
scale.X = Math.Min(scale.X, scale.Y);
scale.Y = scale.X;
var num3 = num1 + 4;
var num4 = num2*scale.Y;
var y1 = (float) (y + height/2.0 - num4/2.0 + 1.0);
GuiData.spriteBatch.DrawString(spriteFont, text, new Vector2(x + 2 + num3, y1), Color.White, 0.0f,
Vector2.Zero, scale, SpriteEffects.None, 0.5f);
}
示例2: tracing
public static bool tracing(Texture2D tok, int row)
{
for (int c = 0; c < token[row].Count; c++)
if (tok.Equals(token[row][c]))
{
Pox[row, c] = c;
amount[row, c]++; return false;
}
return true;
}