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


C# IGraphics.SetColor方法代码示例

本文整理汇总了C#中IGraphics.SetColor方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphics.SetColor方法的具体用法?C# IGraphics.SetColor怎么用?C# IGraphics.SetColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGraphics的用法示例。


在下文中一共展示了IGraphics.SetColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     graphics.DrawObject(Image.Smoke, drawX, drawY, 32, 32, animation / 4, animation % 4, angle);
 }
开发者ID:sinshu,项目名称:dtf,代码行数:7,代码来源:Smoke.cs

示例2: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, r, g, b);
     graphics.DrawObject(Image.BigExplosion, drawX, drawY, 64, 64, animation / 4, animation % 4, angle);
 }
开发者ID:sinshu,项目名称:dtf,代码行数:7,代码来源:BigExplosionEffect.cs

示例3: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     graphics.DrawObject(Image.Mushi, drawX, drawY, 32, 64, type, animation % 3 == 1 ? 1 : 0, angle);
 }
开发者ID:sinshu,项目名称:dtf,代码行数:7,代码来源:Mushi.cs

示例4: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     graphics.DrawBullet(Image.Bullet, drawX, drawY, 16, 16, 0, 0, Angle);
 }
开发者ID:sinshu,项目名称:dtf,代码行数:7,代码来源:PlayerBullet.cs

示例5: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     graphics.DrawObject(Image.RedEnemy, drawX, drawY, 32, 32, 0, 0, angle);
 }
开发者ID:sinshu,项目名称:dtf,代码行数:7,代码来源:RedEnemy.cs

示例6: Draw

        public void Draw(IGraphics g)
        {
            if (Font != null) {
                g.SetFont (Font);
            }
            g.SetColor (Colors.Gray);
            var border = Frame;
            border.Y += PaddingTop;
            border.Height -= PaddingTop + PaddingBottom;

            border.Inflate (-1, -1);
            g.DrawRoundedRect (border, 5, 1);

            var inner = border;
            inner.Inflate (-2, -2);

            if (Checked) {
                g.FillRoundedRect (inner, 3);
                g.SetColor (Colors.Black);
            }

            if (!string.IsNullOrEmpty (Title)) {
                var fm = g.GetFontMetrics ();
                var sw = fm.StringWidth (Title);

                g.DrawString (Title, inner.X + (inner.Width - sw)/2, inner.Y + (inner.Height - fm.Height)/2);
            }
        }
开发者ID:Clancey,项目名称:CrossGraphics,代码行数:28,代码来源:Canvas.cs

示例7: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, type == 0 ? 255 : 0, type == 1 ? 255 : 0, type == 2 ? 255 : 0);
     graphics.DrawObject(Image.Teki, drawX, drawY, 32, 32, 0, 0, angle);
 }
开发者ID:sinshu,项目名称:dtf,代码行数:7,代码来源:Teki.cs

示例8: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     graphics.DrawObject(Image.Clipper, drawX, drawY, 32, 32, 1, 0, 0);
 }
开发者ID:sinshu,项目名称:dtf,代码行数:7,代码来源:Funnel.cs

示例9: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     int a = 15 - animation;
     graphics.SetColor(255, type != 0 ? 255 : 128, type == 2 ? 255 : 128, type == 0 ? 255 : 128);
     graphics.DrawObject(Image.BigExplosion, drawX, drawY, 64, 64, a / 4, a % 4, angle);
 }
开发者ID:sinshu,项目名称:dtf,代码行数:8,代码来源:KurageSpawner.cs

示例10: DrawBackground

 public override void DrawBackground(IGraphics graphics)
 {
     graphics.SetColor(255, 255, 255, 255);
     for (int i = -1; i < 16; i++)
     {
         graphics.DrawBackground(Image.Background3, 0, scroll % 32 + i * 32, 512, 32, 0, 0, BackgroundStretch);
     }
 }
开发者ID:sinshu,项目名称:dtf,代码行数:8,代码来源:GrayBackgoundGame.cs

示例11: Draw

        public void Draw(IGraphics graphics)
        {
            if (ticks < 445)
            {
                graphics.SetColor(255, 0, 0, 0);
                graphics.Fill();

                graphics.EnableAddBlend();
                for (int i = 0; i < CIRCLE_COUNT; i++)
                {
                    int drawX = (int)Math.Round(circleX[i]) - CIRCLE_RADIUS;
                    int drawY = (int)Math.Round(circleY[i]) - CIRCLE_RADIUS;
                    switch (i % 3)
                    {
                        case 0:
                            graphics.SetColor(255, 32, 0, 0);
                            break;
                        case 1:
                            graphics.SetColor(255, 0, 32, 0);
                            break;
                        case 2:
                            graphics.SetColor(255, 0, 0, 32);
                            break;
                    }
                    graphics.DrawImage(Image.Circle, drawX, drawY);
                }
                graphics.DisableAddBlend();

                graphics.SetColor(255, 255, 255, 255);
                graphics.DrawString("TOP SCORES", (640 - 10 * 16) / 2, 48);
                graphics.DrawString("  RANK   SCORE   LEVEL         PLAYER   ", 0, 80);
                for (int i = 0; i < 10; i++)
                {
                    graphics.DrawString(RANK[i], 40, i * 32 + 112);
                    {
                        string s = top10Players[i].Score.ToString();
                        int drawX = 128 + (7 - s.Length) * 16;
                        graphics.DrawString(s, drawX, i * 32 + 112);
                    }
                    {
                        string s = top10Players[i].Level.ToString();
                        int drawX = 296 + (2 - s.Length) * 16;
                        graphics.DrawString(s, drawX, i * 32 + 112);
                    }
                    graphics.DrawString(top10Players[i].Name, 480, i * 32 + 112);
                }
            }
            else
            {
                graphics.SetColor(255, 128, 128, 128);
                graphics.Fill();
                graphics.SetColor(255, 255, 255, 255);
                graphics.DrawImage(Image.Yome, 64, -16, 128, 128, 0, 0, 0, 4);
            }
        }
开发者ID:sinshu,项目名称:dtf,代码行数:55,代码来源:Ranking.cs

示例12: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     for (int i = 0; i < message.Length; i++)
     {
         int targetX = drawX - message[i].Length * 8;
         int targetY = drawY - message.Length * 8 + i * 16;
         graphics.DrawString(message[i], targetX, targetY);
     }
 }
开发者ID:sinshu,项目名称:dtf,代码行数:12,代码来源:EndingMessage.cs

示例13: Draw

 public override void Draw(IGraphics graphics)
 {
     if (isDead)
     {
         return;
     }
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     graphics.DrawObject(Image.Player, drawX, drawY, 32, 32, 0, 0, 0);
     if (warpSpeed > 8)
     {
         graphics.EnableAddBlend();
         int phase = Game.Ticks % 3;
         for (int i = 0; i < 11; i++)
         {
             graphics.SetColor(255, (i + phase) % 3 == 0 ? 255 : 0, (i + phase) % 3 == 1 ? 255 : 0, (i + phase) % 3 == 2 ? 255 : 0);
             graphics.DrawObject(Image.Player, drawX, drawY + i * 48 + phase * 16, 32, 32, 0, 0, 0);
         }
         graphics.DisableAddBlend();
     }
 }
开发者ID:sinshu,项目名称:dtf,代码行数:22,代码来源:Player.cs

示例14: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     graphics.DrawObject(Image.OrangeEnemy, drawX, drawY, 32, 32, 0, 0, angle);
     if (damaged)
     {
         graphics.EnableAddBlend();
         graphics.DrawObject(Image.OrangeEnemy, drawX, drawY, 32, 32, 0, 0, angle);
         graphics.DisableAddBlend();
     }
 }
开发者ID:sinshu,项目名称:dtf,代码行数:13,代码来源:OrangeEnemy.cs

示例15: Draw

 public override void Draw(IGraphics graphics)
 {
     int drawX = (int)Math.Round(X);
     int drawY = (int)Math.Round(Y);
     graphics.SetColor(255, 255, 255, 255);
     graphics.DrawObject(Image.LastBoss, drawX, drawY, 64, 64, 0, animation / 2, 0);
     if (damaged)
     {
         graphics.EnableAddBlend();
         graphics.DrawObject(Image.LastBoss, drawX, drawY, 64, 64, 0, animation / 2, 0);
         graphics.DisableAddBlend();
     }
 }
开发者ID:sinshu,项目名称:dtf,代码行数:13,代码来源:LastBoss.cs


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