本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.Sprite.EnterName方法的典型用法代码示例。如果您正苦于以下问题:C# Sprite.EnterName方法的具体用法?C# Sprite.EnterName怎么用?C# Sprite.EnterName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.Sprite
的用法示例。
在下文中一共展示了Sprite.EnterName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewItems
/// <summary>
/// Adds the newly generated items to the list of items to be displayed.
/// </summary>
private void NewItems()
{
current = generator.GenerateMore();
Texture2D texture = items[18];
for (int i = 0; i <= 9; i++)
{
int height = 0, length = 50;
bool transparent = false;
switch (current[i, 1])
{
case "0": height = 499; break;
case "1": height = 399; break;
case "2": height = 299; break;
}
switch (current[i, 0])
{
case "tomato": texture = items[0]; break;
case "carrot": texture = items[1]; break;
case "strawberry": texture = items[2]; break;
case "orange": texture = items[3]; break;
case "pineapple": texture = items[4]; break;
case "broccoli": texture = items[5]; break;
case "fries": texture = items[6]; break;
case "hamburger": texture = items[7]; break;
case "pizza": texture = items[8]; break;
case "donut": texture = items[9]; break;
case "muffin": texture = items[10]; break;
case "hotdog": texture = items[11]; break;
case "level1": texture = items[12]; break;
case "level2": texture = items[13]; break;
case "level3": texture = items[14]; break;
case "sheild": texture = items[15]; break;
case "sword": texture = items[16]; break;
case "gym": texture = items[17]; length = 200; height = 349; break;
case "Empty": transparent = true; break;
default: break;
}
if (current[i, 0].Contains("boss"))
{
texture = items[19];
length = 200;
height = 349;
}
if (!transparent)
{
Sprite sprite = new Sprite(texture, new Rectangle(1280, height, length, length), Content);
sprite.EnterName(current[i, 0]);
currentSprite.Add(sprite);
}
}
}