当前位置: 首页>>代码示例>>C#>>正文


C# SpriteBatch.DrawOutline方法代码示例

本文整理汇总了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;
                 }
             }
         }
     }
 }
开发者ID:eriksk,项目名称:NibLibMapEditor,代码行数:27,代码来源:LayerComponent.cs

示例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);
             }
         }
     }
 }
开发者ID:eriksk,项目名称:Animet,代码行数:16,代码来源:TextureContainer.cs

示例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);
     }
 }
开发者ID:eriksk,项目名称:Animet,代码行数:9,代码来源:AnimationComponent.cs

示例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);
 }
开发者ID:eriksk,项目名称:Animet,代码行数:10,代码来源:Button.cs

示例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);
             }
         }
     }
 }
开发者ID:eriksk,项目名称:Animet,代码行数:20,代码来源:FrameContainer.cs

示例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);
                    }
                }
            }
        }
开发者ID:eriksk,项目名称:NibLibMapEditor,代码行数:22,代码来源:CollisionComponent.cs

示例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);
 }
开发者ID:eriksk,项目名称:Animet,代码行数:6,代码来源:TextBox.cs


注:本文中的Microsoft.Xna.Framework.Graphics.SpriteBatch.DrawOutline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。