當前位置: 首頁>>代碼示例>>C#>>正文


C# GraphicsDevice.FillScreen方法代碼示例

本文整理匯總了C#中MiswGame2007.GraphicsDevice.FillScreen方法的典型用法代碼示例。如果您正苦於以下問題:C# GraphicsDevice.FillScreen方法的具體用法?C# GraphicsDevice.FillScreen怎麽用?C# GraphicsDevice.FillScreen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MiswGame2007.GraphicsDevice的用法示例。


在下文中一共展示了GraphicsDevice.FillScreen方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Draw

        public void Draw(GraphicsDevice graphics)
        {
            graphics.FillScreen(0, 0, 0, 192);

            graphics.DrawImageAdd(GameImage.Message, 256, 32, 3, 0, (Settings.SCREEN_WIDTH - 256) / 2, Settings.SCREEN_HEIGHT / 2 - 80, 255);

            if (currentStageIndex + 1 < 10)
            {
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, currentStageIndex + 1, (Settings.SCREEN_WIDTH - 32) / 2, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
            }
            else
            {
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, (currentStageIndex + 1) / 10, (Settings.SCREEN_WIDTH - 64) / 2, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, (currentStageIndex + 1) % 10, (Settings.SCREEN_WIDTH - 64) / 2 + 32, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
            }

            if (currentStageIndex > 0)
            {
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, Settings.SCREEN_WIDTH / 2 - 80, Settings.SCREEN_HEIGHT / 2 - 16);
            }
            if (currentStageIndex + 1 < numUnlockedStages)
            {
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH / 2 + 48, Settings.SCREEN_HEIGHT / 2 - 16);
            }

            if (gotoGameCount > 0)
            {
                if (gotoGameCount < 16)
                {
                    graphics.FillScreen(255, 255, 255, 16 * gotoGameCount);
                }
                else
                {
                    graphics.FillScreen(255, 255, 255, 255);
                }
            }
        }
開發者ID:sinshu,項目名稱:chaos,代碼行數:37,代碼來源:StageSelectScene.cs

示例2: Draw

        public virtual void Draw(GraphicsDevice graphics)
        {
            DrawBackground(graphics);
            backgroundParticles.Draw(graphics);
            DrawMap(graphics);
            if (door != null)
            {
                door.Draw(graphics);
            }
            // particles.Draw(graphics);
            enemies.Draw(graphics);
            if (player != null)
            {
                player.Draw(graphics);
            }
            items.Draw(graphics);
            particles.Draw(graphics);
            playerBullets.Draw(graphics);
            enemyBullets.Draw(graphics);
            if (door != null)
            {
                door.Draw2(graphics);
            }

            DrawSomething(graphics);

            if (flash > 0)
            {
                graphics.FillScreen(255, 255, 255, flash);
            }

            if (player != null)
            {
                if (player.DamageCount > 0)
                {
                    graphics.FillScreen(255, 0, 0, player.DamageCount / 2);
                }

                if (numTicks < 16)
                {
                    graphics.FillScreen(255, 255, 255, 255 - numTicks * 16);
                }

                if (cleared)
                {
                    if (clearTimer < 16)
                    {
                        graphics.FillScreen(255, 255, 255, clearTimer * 16);
                    }
                    else
                    {
                        graphics.FillScreen(255, 255, 255, 255);
                    }
                }

                DrawHud(graphics);

                if (gameover)
                {
                    if (gameoverTimer < 256)
                    {
                        if (gameoverTimer > 240)
                        {
                            graphics.FillScreen(0, 0, 0, (gameoverTimer - 240) * 16);
                        }
                    }
                    else
                    {
                        graphics.FillScreen(0, 0, 0, 255);
                    }
                }
            }
        }
開發者ID:sinshu,項目名稱:chaos,代碼行數:73,代碼來源:GameScene.cs

示例3: Draw

        public void Draw(GraphicsDevice graphics)
        {
            if (numTicks < 128)
            {
                int color = 255 - 2 * numTicks;
                graphics.FillScreen(color, color, color, 255);
            }
            else
            {
                graphics.FillScreen(0, 0, 0, 255);
            }
            DrawMessage(4 * 60, 16 * 60, 0, graphics, Message.ChaoslugStaff);
            DrawMessage(16 * 60, 24 * 60, 0, graphics, Message.ProjectLeader, Message.Macoto);
            DrawMessage(24 * 60, 32 * 60, 0, graphics, Message.Program, Message.Sinshu);
            DrawMessage(32 * 60, 40 * 60, 0, graphics, Message.Music, Message.Yutaka, Message.Yousuke, Message.Sinshu);
            DrawMessage(40 * 60, 48 * 60, 0, graphics, Message.Graphics, Message.Macoto, Message.Sinshu, Message.Iori);
            DrawMessage(48 * 60, 56 * 60, 0, graphics, Message.StageConstruction, Message.Crimson, Message.Zhon, Message.Tetsu, Message.Sinshu);
            DrawMessage(56 * 60, 64 * 60, 0, graphics, Message.Voice, Message.Zhon);
            DrawMessage(64 * 60, 72 * 60, 0, graphics, Message.SpecialThanks, Message.MiswMember);
            DrawMessage(72 * 60, 88 * 60, -128, graphics, Message.ThankYouForPlaying);
            DrawPenguin(72 * 60, 88 * 60, 32, graphics);

            if (forceExit)
            {
                if (forceExitCount < 16)
                {
                    graphics.FillScreen(0, 0, 0, 16 * forceExitCount);
                }
                else
                {
                    graphics.FillScreen(0, 0, 0, 255);
                }
            }
        }
開發者ID:sinshu,項目名稱:chaos,代碼行數:34,代碼來源:EndingScene.cs

示例4: Draw

        public void Draw(GraphicsDevice graphics)
        {
            game.Draw(graphics);

            if (numTicks < 16)
            {
                graphics.FillScreen(0, 0, 0, 255 - numTicks * 16);
            }

            if (numTicks == 165)
            {
                graphics.FillScreen(255, 255, 255, 255);
            }

            if (numTicks > 180)
            {
                for (int i = 0; i < 3; i++)
                {
                    graphics.DrawImageAdd(GameImage.Message, 256, 32, i, 0, (Settings.SCREEN_WIDTH - 256) / 2, Settings.SCREEN_HEIGHT / 2 + 112 + 32 * i, (i <= 1 || !arcadeMode) ? 255 : 32);
                }
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, (Settings.SCREEN_WIDTH - 256) / 2 - 32 + 48, Settings.SCREEN_HEIGHT / 2 + 112 + currentSelectIndex * 32);
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, (Settings.SCREEN_WIDTH - 256) / 2 + 256 - 48, Settings.SCREEN_HEIGHT / 2 + 112 + currentSelectIndex * 32);
            }

            if (gotoGameCount > 0)
            {
                if (gotoGameCount < 16)
                {
                    graphics.FillScreen(255, 255, 255, 16 * gotoGameCount);
                }
                else
                {
                    graphics.FillScreen(255, 255, 255, 255);
                }
            }

            if (exitCount > 0)
            {
                if (exitCount < 16)
                {
                    graphics.FillScreen(0, 0, 0, 16 * exitCount);
                }
                else
                {
                    graphics.FillScreen(0, 0, 0, 255);
                }
            }
        }
開發者ID:sinshu,項目名稱:chaos,代碼行數:48,代碼來源:TitleScene.cs


注:本文中的MiswGame2007.GraphicsDevice.FillScreen方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。