本文整理汇总了C#中Item.GetTexture方法的典型用法代码示例。如果您正苦于以下问题:C# Item.GetTexture方法的具体用法?C# Item.GetTexture怎么用?C# Item.GetTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item.GetTexture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawItem
static void DrawItem(Item item, SpriteBatch sb, Vector2 position, Color? tint = null)
{
sb.Draw(item.GetTexture(), position, item.GetAlpha(tint ?? Color.White));
if (item.color != default(Color))
sb.Draw(item.GetTexture(), position, ComposeColour(item, tint));
}
示例2: Draw
public override void Draw(SpriteBatch sb, bool mouseOver)
{
//base.Draw(sb, mouseOver);
StarterSet set = StarterSet.Sets[StarterSet.SelectedSet];
Item drawItem = new Item();
for (int i = 0; i < set.Items.Length; i++)
{
drawItem.netDefaults(set.Items[i]);
DrawItem(drawItem, sb, position + new Vector2(0f, i * (drawItem.GetTexture().Height + 5f)));
//sb.Draw(drawItem.GetTexture(), position + new Vector2(0f, i * (drawItem.GetTexture().Height + 5f)), ComposeColour(drawItem));
}
if (set.ArmourHead != 0)
{
drawItem.netDefaults(set.ArmourHead);
DrawItem(drawItem, sb, position + new Vector2(ARMOUR_OFFSET, 0f));
//sb.Draw(drawItem.GetTexture(), position + new Vector2(ARMOUR_OFFSET, 0f ), ComposeColour(drawItem));
}
if (set.ArmourBody != 0)
{
drawItem.netDefaults(set.ArmourBody);
DrawItem(drawItem, sb, position + new Vector2(ARMOUR_OFFSET, 2f * drawItem.GetTexture().Height + 5f));
//sb.Draw(drawItem.GetTexture(), position + new Vector2(ARMOUR_OFFSET, 2f * drawItem.GetTexture().Height + 5f), ComposeColour(drawItem));
}
if (set.ArmourLegs != 0)
{
drawItem.netDefaults(set.ArmourLegs);
DrawItem(drawItem, sb, position + new Vector2(ARMOUR_OFFSET, 4f * drawItem.GetTexture().Height + 10f));
//sb.Draw(drawItem.GetTexture(), position + new Vector2(ARMOUR_OFFSET, 4f * drawItem.GetTexture().Height + 10f), ComposeColour(drawItem));
}
}
示例3: DrawItem
static void DrawItem(Item item, SpriteBatch sb, Vector2 position, float rotation,
Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, Color? tint = null)
{
sb.Draw(item.GetTexture(), position, item.GetAlpha(tint ?? Color.White));
if (item.color != default(Color))
sb.Draw(item.GetTexture(), position, null, ComposeColour(item, tint), rotation, origin, scale, effects, layerDepth);
}