本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.SpriteBatch.DrawOutline方法的典型用法代码示例。如果您正苦于以下问题:C# SpriteBatch.DrawOutline方法的具体用法?C# SpriteBatch.DrawOutline怎么用?C# SpriteBatch.DrawOutline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.SpriteBatch
的用法示例。
在下文中一共展示了SpriteBatch.DrawOutline方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public void Draw(SpriteBatch sb, Game1 game)
{
if (layer != null)
{
for (int i = 0; i < layer.parts.Count; i++)
{
if (selectedPart == i)
{
MapPart fp = layer.parts[selectedPart];
sb.DrawOutline(pixel, Util.RotateRectangle(fp.origin, fp.position, fp.scale, fp.rotation), Color.White * 0.5f);
}
}
if (selectedPart == -1)
{
for (int i = layer.parts.Count - 1; i >= 0; i--)
{
MapPart fp = layer.parts[i];
if (Util.RotateRectangle(fp.origin, fp.position, fp.scale, fp.rotation).Contains(game.MPos.X, game.MPos.Y))
{
sb.Draw(pixel, Util.RotateRectangle(fp.origin, fp.position, fp.scale, fp.rotation), Color.Red * 0.1f);
sb.DrawOutline(pixel, Util.RotateRectangle(fp.origin, fp.position, fp.scale, fp.rotation), Color.Red * 0.8f);
break;
}
}
}
}
}
示例2: Draw
public void Draw(SpriteBatch sb)
{
if (k.IsKeyDown(Keys.LeftShift))
{
sb.Draw(pixel, rect, Color.Black * 0.2f);
sb.DrawOutline(pixel, rect, Color.Black);
sb.Draw(texture, rect, Color.White * 0.8f);
if (rect.Contains(m.X, m.Y))
{
if (m.LeftButton == ButtonState.Pressed || om.LeftButton == ButtonState.Pressed)
{
sb.DrawOutline(pixel, new Rectangle(rect.X + source.X, rect.Y + source.Y, source.Width, source.Height), Color.Red);
}
}
}
}
示例3: Draw
public void Draw(SpriteBatch sb)
{
sb.Draw(pixel, rect, bgColor);
sb.DrawOutline(pixel, rect, Color.Black);
if (anim != null)
{
anim.Draw(sb, new Vector2(rect.Center.X, rect.Center.Y), false);
}
}
示例4: Draw
public void Draw(SpriteBatch sb)
{
sb.Draw(pixel, rect, bgColor);
sb.DrawOutline(pixel, rect, Color.Black);
if (rect.Contains(m.X, m.Y))
{
sb.Draw(pixel, rect, Color.White * 0.5f);
}
sb.DrawString(font, text, new Vector2(rect.X + padding, rect.Y + padding), Color.White);
}
示例5: Draw
public void Draw(SpriteBatch sb)
{
sb.Draw(pixel, rect, bgColor);
sb.DrawOutline(pixel, rect, Color.Black);
if (frame != null)
{
sb.DrawOutline(pixel, new Rectangle(rect.Left, rect.Center.Y, rect.Width, 1), Color.Black * 0.5f);
sb.DrawOutline(pixel, new Rectangle(rect.Center.X, rect.Top, 1, rect.Height), Color.Black * 0.5f);
Vector2 pos = new Vector2(rect.Center.X, rect.Center.Y);
frame.Draw(sb, pos, false);
for (int i = 0; i < frame.parts.Count; i++)
{
if (selectedPart == i)
{
FramePart fp = frame.parts[selectedPart];
sb.DrawOutline(pixel, Util.RotateRectangle(fp.origin, pos + fp.position, fp.scale, fp.rotation), Color.White * 0.5f);
}
}
}
}
示例6: Draw
public void Draw(SpriteBatch sb, Game1 game)
{
for (int i = 0; i < ledges.Count; i++)
{
ledges[i].Draw(sb, pixel, selectedLedge == i);
}
for (int i = 0; i < grid.GetLength(0); i++)
{
for (int j = 0; j < grid.GetLength(1); j++)
{
if (grid[i, j] != 0)
{
sb.Draw(pixel, new Rectangle(i * Map.CELL_SIZE, j * Map.CELL_SIZE, Map.CELL_SIZE, Map.CELL_SIZE), Color.Red * 0.2f);
}
else
{
sb.DrawOutline(pixel, new Rectangle(i * Map.CELL_SIZE, j * Map.CELL_SIZE, Map.CELL_SIZE, Map.CELL_SIZE), Color.Red * 0.2f);
}
}
}
}
示例7: Draw
public void Draw(SpriteBatch sb)
{
sb.Draw(pixel, rect, bgColor);
sb.DrawOutline(pixel, rect, Color.Black);
sb.DrawString(font, nameable.Name + (showCursor ? "" : "|"), new Vector2(rect.X + padding, rect.Y + padding), Color.White);
}