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


C# GraphicsDevice.DrawImageFix方法代码示例

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


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

示例1: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     if (direction == Direction.Left)
     {
         int textureCol = animation / 4;
         if (openCount == -1)
         {
             graphics.DrawImageFix(GameImage.House, 64, 64, 0, textureCol, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFix(GameImage.House, 64, 64, 1, openCount / 2, drawX, drawY, this);
         }
     }
     else
     {
         int textureCol = animation / 4;
         if (openCount == -1)
         {
             graphics.DrawImageFixFlip(GameImage.House, 64, 64, 0, textureCol, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFixFlip(GameImage.House, 64, 64, 1, openCount / 2, drawX, drawY, this);
         }
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:29,代码来源:House.cs

示例2: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     if (direction == Direction.Left)
     {
         if (idle)
         {
             graphics.DrawImageFix(GameImage.EggMachine, 128, 128, 0, animation, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFix(GameImage.EggMachine, 128, 128, 1, animation, drawX, drawY, this);
         }
     }
     else
     {
         if (idle)
         {
             graphics.DrawImageFixFlip(GameImage.EggMachine, 128, 128, 0, animation, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFixFlip(GameImage.EggMachine, 128, 128, 1, animation, drawX, drawY, this);
         }
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:27,代码来源:EggMachine.cs

示例3: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     if (direction == Direction.Left)
     {
         if (currentState == State.Run)
         {
             graphics.DrawImageFix(GameImage.Robot, 128, 256, 0, animation / 4, drawX, drawY, this);
         }
         else if (currentState == State.Attack)
         {
             if (attackCount < 32)
             {
                 graphics.DrawImageFix(GameImage.Robot, 128, 256, 1, attackCount / 4, drawX, drawY, this);
             }
             else if (attackCount < 128)
             {
                 graphics.DrawImageFix(GameImage.Robot, 128, 256, 1, 7, drawX, drawY, this);
             }
             else
             {
                 graphics.DrawImageFix(GameImage.Robot, 128, 256, 1, 7 - (attackCount - 128) / 4, drawX, drawY, this);
             }
         }
         else
         {
             if (jumpCount < 10)
             {
                 graphics.DrawImageFix(GameImage.Robot, 128, 256, 1, jumpCount / 2, drawX, drawY, this);
             }
             else if (jumpCount < 16)
             {
                 graphics.DrawImageFix(GameImage.Robot, 128, 256, 1, 4 - (jumpCount - 10) / 2, drawX, drawY, this);
             }
             else
             {
                 graphics.DrawImageFix(GameImage.Robot, 128, 256, 1, 2, drawX, drawY, this);
             }
         }
     }
     else
     {
         if (currentState == State.Run)
         {
             graphics.DrawImageFixFlip(GameImage.Robot, 128, 256, 0, animation / 4, drawX, drawY, this);
         }
         else if (currentState == State.Attack)
         {
             if (attackCount < 32)
             {
                 graphics.DrawImageFixFlip(GameImage.Robot, 128, 256, 1, attackCount / 4, drawX, drawY, this);
             }
             else if (attackCount < 128)
             {
                 graphics.DrawImageFixFlip(GameImage.Robot, 128, 256, 1, 7, drawX, drawY, this);
             }
             else
             {
                 graphics.DrawImageFixFlip(GameImage.Robot, 128, 256, 1, 7 - (attackCount - 128) / 4, drawX, drawY, this);
             }
         }
         else
         {
             if (jumpCount < 10)
             {
                 graphics.DrawImageFixFlip(GameImage.Robot, 128, 256, 1, jumpCount / 2, drawX, drawY, this);
             }
             else if (jumpCount < 16)
             {
                 graphics.DrawImageFixFlip(GameImage.Robot, 128, 256, 1, 4 - (jumpCount - 10) / 2, drawX, drawY, this);
             }
             else
             {
                 graphics.DrawImageFixFlip(GameImage.Robot, 128, 256, 1, 2, drawX, drawY, this);
             }
         }
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:79,代码来源:BossRobot.cs

示例4: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     if (!ghost)
     {
         if (direction == Direction.Left)
         {
             if (!attacking)
             {
                 graphics.DrawImageFix(GameImage.Norio, 128, 128, 0, 0, drawX, drawY, this);
             }
             else
             {
                 if (attackCount < 32 && (attackCount / 4) % 2 == 0)
                 {
                     graphics.DrawImageFix(GameImage.Norio, 128, 128, 0, 0, drawX, drawY, this);
                 }
                 else
                 {
                     graphics.DrawImageFix(GameImage.Norio, 128, 128, 1, 0, drawX, drawY, this);
                 }
             }
         }
         else
         {
             if (!attacking)
             {
                 graphics.DrawImageFixFlip(GameImage.Norio, 128, 128, 0, 0, drawX, drawY, this);
             }
             else
             {
                 if (attackCount < 32 && (attackCount / 4) % 2 == 0)
                 {
                     graphics.DrawImageFixFlip(GameImage.Norio, 128, 128, 0, 0, drawX, drawY, this);
                 }
                 else
                 {
                     graphics.DrawImageFixFlip(GameImage.Norio, 128, 128, 1, 0, drawX, drawY, this);
                 }
             }
         }
     }
     else
     {
         if (direction == Direction.Left)
         {
             if (!attacking)
             {
                 graphics.DrawImageAlphaFix(GameImage.Norio, 128, 128, 0, 0, drawX, drawY, this, 128);
             }
             else
             {
                 if (attackCount < 32 && (attackCount / 4) % 2 == 0)
                 {
                     graphics.DrawImageAlphaFix(GameImage.Norio, 128, 128, 0, 0, drawX, drawY, this, 128);
                 }
                 else
                 {
                     graphics.DrawImageAlphaFix(GameImage.Norio, 128, 128, 1, 0, drawX, drawY, this, 128);
                 }
             }
         }
         else
         {
             if (!attacking)
             {
                 graphics.DrawImageAlphaFixFlip(GameImage.Norio, 128, 128, 0, 0, drawX, drawY, this, 128);
             }
             else
             {
                 if (attackCount < 32 && (attackCount / 4) % 2 == 0)
                 {
                     graphics.DrawImageAlphaFixFlip(GameImage.Norio, 128, 128, 0, 0, drawX, drawY, this, 128);
                 }
                 else
                 {
                     graphics.DrawImageAlphaFixFlip(GameImage.Norio, 128, 128, 1, 0, drawX, drawY, this, 128);
                 }
             }
         }
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:83,代码来源:Norio.cs

示例5: DrawNormal

        private void DrawNormal(GraphicsDevice graphics, int animation)
        {
            int drawX = (int)Math.Round(position.X) - game.IntCameraX;
            int drawY = (int)Math.Round(position.Y) - game.IntCameraY;

            graphics.DrawImageFix(GameImage.Father, 128, 256, 0, animation % 8, drawX, drawY, this);
        }
开发者ID:sinshu,项目名称:chaos,代码行数:7,代码来源:Father.cs

示例6: DrawSpin

        private void DrawSpin(GraphicsDevice graphics, int animation)
        {
            int drawX = (int)Math.Round(position.X) - game.IntCameraX;
            int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
            int rotate = animation % 16;

            if (rotate < 8)
            {
                graphics.DrawImageFix(GameImage.Father, 128, 256, 1, rotate, drawX, drawY, this);
            }
            else
            {
                graphics.DrawImageFixFlip(GameImage.Father, 128, 256, 1, 15 - rotate, drawX, drawY, this);
            }
        }
开发者ID:sinshu,项目名称:chaos,代码行数:15,代码来源:Father.cs

示例7: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     if (stateCount < 32)
     {
         graphics.DrawImageFix(GameImage.MushroomBoss2, 256, 256, animation / 8, animation % 8, drawX, drawY, this);
     }
     else if (stateCount < 128)
     {
         graphics.DrawImageFix(GameImage.MushroomBoss1, 256, 256, animation / 8, animation % 8, drawX, drawY, this);
     }
     else if (stateCount < 256)
     {
         if (animation % 8 == 0)
         {
             graphics.DrawImageFix(GameImage.MushroomBoss1, 256, 256, 0, 0, drawX, drawY, this);
         }
         else if (animation <= 4)
         {
             graphics.DrawImageFix(GameImage.MushroomBoss3, 256, 256, 0, animation - 1, drawX, drawY, this);
         }
         else if (animation <= 7)
         {
             graphics.DrawImageFix(GameImage.MushroomBoss3, 256, 256, 0, 7 - animation, drawX, drawY, this);
         }
         else if (animation <= 12)
         {
             graphics.DrawImageFix(GameImage.MushroomBoss3, 256, 256, 1, animation - 9, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFix(GameImage.MushroomBoss3, 256, 256, 1, 15 - animation, drawX, drawY, this);
         }
     }
     else if (stateCount < 480)
     {
         graphics.DrawImageFix(GameImage.MushroomBoss1, 256, 256, animation / 8, animation % 8, drawX, drawY, this);
     }
     else
     {
         graphics.DrawImageFix(GameImage.MushroomBoss2, 256, 256, animation / 8, animation % 8, drawX, drawY, this);
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:44,代码来源:BossMushroom.cs

示例8: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     int textureCol = animation / 2;
     if (direction == Direction.Left)
     {
         if (currentState != State.Attack)
         {
             graphics.DrawImageFix(GameImage.Baaka, 96, 96, 0, textureCol, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFix(GameImage.Baaka, 96, 96, 0, 8, drawX, drawY, this);
         }
     }
     else
     {
         if (currentState != State.Attack)
         {
             graphics.DrawImageFixFlip(GameImage.Baaka, 96, 96, 0, textureCol, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFixFlip(GameImage.Baaka, 96, 96, 0, 8, drawX, drawY, this);
         }
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:28,代码来源:Baaka.cs

示例9: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     if (direction == Direction.Left)
     {
         if (!attacking)
         {
             graphics.DrawImageFix(GameImage.BlackPlayer, 32, 64, 0, animation / 2, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFix(GameImage.BlackPlayer, 32, 64, 1, fireAnimation, drawX, drawY, this);
         }
     }
     else
     {
         if (!attacking)
         {
             graphics.DrawImageFixFlip(GameImage.BlackPlayer, 32, 64, 0, animation / 2, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFixFlip(GameImage.BlackPlayer, 32, 64, 1, fireAnimation, drawX, drawY, this);
         }
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:27,代码来源:BlackPlayer.cs

示例10: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     graphics.DrawImageFix(GameImage.Oyaji, 128, 128, 0, animation, drawX, drawY, this);
 }
开发者ID:sinshu,项目名称:chaos,代码行数:6,代码来源:Oyaji.cs

示例11: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     int textureCol = animation / 2;
     switch (currentState)
     {
         case State.Rise:
             if (direction == Direction.Left)
             {
                 graphics.DrawImageFix(GameImage.Mushroom, 32, 32, 0, textureCol, drawX, drawY, this);
             }
             else
             {
                 graphics.DrawImageFixFlip(GameImage.Mushroom, 32, 32, 0, textureCol, drawX, drawY, this);
             }
             break;
         case State.Wait:
             if (direction == Direction.Left)
             {
                 graphics.DrawImageFix(GameImage.Mushroom, 32, 32, 0, 7, drawX, drawY, this);
             }
             else
             {
                 graphics.DrawImageFixFlip(GameImage.Mushroom, 32, 32, 0, 7, drawX, drawY, this);
             }
             break;
         case State.Attack:
             graphics.DrawImageRotate(GameImage.Mushroom, 32, 32, 1, textureCol, drawX + 16, drawY + 16, 16, 16, (int)Math.Round(angle));
             break;
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:32,代码来源:Mushroom.cs

示例12: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     int textureRow = 0;
     int textureCol = animation / 2;
     if (direction == Direction.Left)
     {
         if (!attackJump)
         {
             graphics.DrawImageFix(GameImage.Babo, 64, 64, textureRow, textureCol, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFix(GameImage.Babo, 64, 64, textureRow + 1, textureCol, drawX, drawY, this);
         }
     }
     else
     {
         if (!attackJump)
         {
             graphics.DrawImageFixFlip(GameImage.Babo, 64, 64, textureRow, textureCol, drawX, drawY, this);
         }
         else
         {
             graphics.DrawImageFixFlip(GameImage.Babo, 64, 64, textureRow + 1, textureCol, drawX, drawY, this);
         }
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:29,代码来源:Babo.cs

示例13: Draw

        public override void Draw(GraphicsDevice graphics)
        {
            int drawX = (int)Math.Round(position.X) - game.IntCameraX;
            int drawY = (int)Math.Round(position.Y) - game.IntCameraY;

            int animation = 0;
            if (openCount < 32)
            {
                animation = openCount / 4;
            }
            else if (openCount < 224)
            {
                animation = 7;
            }
            else
            {
                animation = 7 - (openCount - 224) / 4;
            }

            if (attacking && openCount < 128)
            {
                int enemyX = (int)Math.Round(position.X + 64) - game.IntCameraX;
                int enemyY = 0;
                if (openCount < 96)
                {
                    enemyY = (int)Math.Round(position.Y + 128) - game.IntCameraY;
                }
                else
                {
                    enemyY = (int)Math.Round(position.Y + 128 - 4 * (openCount - 96)) - game.IntCameraY;
                }
                if (enemy == OutEnemy.Byaa)
                {
                    graphics.DrawImageFix(GameImage.Byaa, 128, 128, 0, 0, enemyX, enemyY, this);
                }
                else if (enemy == OutEnemy.Nurunuru)
                {
                    graphics.DrawImageFix(GameImage.Nurunuru, 128, 128, 0, 0, enemyX, enemyY, this);
                }
            }

            graphics.DrawImageFix(GameImage.HouseBoss, 256, 256, animation / 4, animation % 4, drawX, drawY, this);
        }
开发者ID:sinshu,项目名称:chaos,代码行数:43,代码来源:BossHouse.cs

示例14: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     if (direction == Direction.Left)
     {
         int textureCol = animation / 4;
         if (!attacking)
         {
             graphics.DrawImageFix(GameImage.Kyoro, 64, 64, 0, textureCol, drawX, drawY, this);
         }
         else
         {
             if (attackCount < 8)
             {
                 graphics.DrawImageFix(GameImage.Kyoro, 64, 64, 1, attackCount / 2, drawX, drawY, this);
             }
             else if (attackCount < 24)
             {
                 graphics.DrawImageFix(GameImage.Kyoro, 64, 64, 1, 3, drawX, drawY, this);
             }
             else
             {
                 graphics.DrawImageFix(GameImage.Kyoro, 64, 64, 1, 3 - (attackCount - 24) / 2, drawX, drawY, this);
             }
         }
     }
     else
     {
         int textureCol = animation / 4;
         if (!attacking)
         {
             graphics.DrawImageFixFlip(GameImage.Kyoro, 64, 64, 0, textureCol, drawX, drawY, this);
         }
         else
         {
             if (attackCount < 8)
             {
                 graphics.DrawImageFixFlip(GameImage.Kyoro, 64, 64, 1, attackCount / 2, drawX, drawY, this);
             }
             else if (attackCount < 24)
             {
                 graphics.DrawImageFixFlip(GameImage.Kyoro, 64, 64, 1, 3, drawX, drawY, this);
             }
             else
             {
                 graphics.DrawImageFixFlip(GameImage.Kyoro, 64, 64, 1, 3 - (attackCount - 24) / 2, drawX, drawY, this);
             }
         }
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:51,代码来源:Kyoro.cs

示例15: Draw

 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     int textureCol = 3;
     if (stateCount < 16)
     {
         textureCol = stateCount / 4;
     }
     if (flipAnimation)
     {
         textureCol = 3 - textureCol;
     }
     if (direction == Direction.Left)
     {
         graphics.DrawImageFix(GameImage.Skater, 96, 96, 0, textureCol, drawX, drawY, this);
     }
     else
     {
         graphics.DrawImageFixFlip(GameImage.Skater, 96, 96, 0, textureCol, drawX, drawY, this);
     }
 }
开发者ID:sinshu,项目名称:chaos,代码行数:22,代码来源:Skater.cs


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