示例#1
0
        private IEnumerable <bool> DrawString(int x, int y, string text, int frameMax = 600)
        {
            double b     = 0.0;
            double bTarg = 1.0;

            foreach (DDScene scene in DDSceneUtils.Create(frameMax))
            {
                if (scene.Numer == scene.Denom - 300)
                {
                    bTarg = 0.0;
                }

                DDUtils.Approach(ref b, bTarg, 0.99);

                I3Color color = new I3Color(
                    SCommon.ToInt(b * 255),
                    SCommon.ToInt(b * 255),
                    SCommon.ToInt(b * 255)
                    );

                DDFontUtils.DrawString_XCenter(x, y, text, DDFontUtils.GetFont("K\u30b4\u30b7\u30c3\u30af", 30), false, color);

                yield return(true);
            }
        }
示例#2
0
        public void Perform()
        {
            DDCurtain.SetCurtain();
            DDEngine.FreezeInput();

            Ground.I.Music.Filed_01.Play();

            long frmProcMilAvgNumer = 0L;
            long frmProcMilAvgDenom = 0L;

            int effectPerFrm = 10;
            int effectCount  = 1;

            for (; ;)
            {
                if (DDInput.PAUSE.IsPound())
                {
                    break;
                }
                if (DDInput.A.IsPound())
                {
                    effectPerFrm--;
                }
                if (DDInput.B.IsPound())
                {
                    effectPerFrm++;
                }
                if (DDInput.C.IsPound())
                {
                    effectCount++;
                }
                if (DDInput.D.IsPound())
                {
                    effectCount--;
                }
                effectPerFrm = IntTools.ToRange(effectPerFrm, 1, 10);
                effectCount  = IntTools.ToRange(effectCount, 1, 100);

                if (DDEngine.ProcFrame % effectPerFrm == 0)
                {
                    for (int c = 0; c < effectCount; c++)
                    {
                        new DDCommonEffect(DDGround.GeneralResource.Dummy)
                        {
                            X     = 400.0,
                            Y     = 300.0,
                            Z     = 0.5,
                            XAdd2 = Math.Cos(DDEngine.ProcFrame / 100.0 + c) * 0.1,
                            YAdd2 = Math.Sin(DDEngine.ProcFrame / 100.0 + c) * 0.1,
                        }
                        .Fire();
                    }
                }
                this.DrawWall();



                // フォントのテスト
                DDFontUtils.DrawString_XCenter(
                    400, 20,
                    "げんかいみんちょう",
                    DDFontUtils.GetFont("源界明朝", 70, 6, true, 2)
                    );
                DDFontUtils.DrawString_XCenter(
                    400, 520,
                    "りいてがき",
                    DDFontUtils.GetFont("りいてがき筆", 50, 6, true, 2)
                    );



                frmProcMilAvgNumer += DDEngine.FrameProcessingMillis;
                frmProcMilAvgDenom++;

                double frmProcMilAvg = (double)frmProcMilAvgNumer / frmProcMilAvgDenom;

                if (DDEngine.ProcFrame % 100 == 0)
                {
                    frmProcMilAvgNumer /= 2;
                    frmProcMilAvgDenom /= 2;
                }

                DDDraw.SetTaskList(DDGround.EL);
                DDDraw.SetAlpha(0.5);
                DDDraw.SetBright(new I3Color(0, 0, 0));
                DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, 0, 0, DDConsts.Screen_W, 16);
                DDDraw.Reset();

                DDPrint.SetPrint();
                DDPrint.SetTaskList(DDGround.EL);
                DDPrint.SetColor(new I3Color(255, 128, 0));
                DDPrint.Print(string.Format(
                                  "FST={0},HCT={1},FPM={2},FPW={3},FPMA={4:F3}(EPF={5},EC={6},ELC={7})"
                                  , DDEngine.FrameStartTime
                                  , DDEngine.HzChaserTime
                                  , DDEngine.FrameProcessingMillis
                                  , DDEngine.FrameProcessingMillis_Worst
                                  , frmProcMilAvg
                                  , effectPerFrm
                                  , effectCount
                                  , DDGround.EL.Count
                                  ));
                DDPrint.Reset();



                DDEngine.EachFrame();
            }
            DDEngine.FreezeInput();
            DDMusicUtils.Fade();
            DDCurtain.SetCurtain(30, -1.0);

            foreach (DDScene scene in DDSceneUtils.Create(40))
            {
                this.DrawWall();
                DDEngine.EachFrame();
            }
            DDGround.EL.Clear();
        }
示例#3
0
        private IEnumerable <bool> DrawString(int x, int y, string text, int frameMax = 600)
        {
            DDSubScreen subScreenTmp = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H, true);
            DDSubScreen subScreen    = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H, true);

            SubScreens.Add(subScreenTmp);
            SubScreens.Add(subScreen);

            using (subScreenTmp.Section())
            {
                DX.ClearDrawScreen();

                DDFontUtils.DrawString_XCenter(x, y, text, DDFontUtils.GetFont("K\u30b4\u30b7\u30c3\u30af", 30));

                ぼかし効果.Perform(0.01);
            }
            for (int c = 0; c < 3; c++)
            {
                using (subScreen.Section())
                {
                    DX.ClearDrawScreen();

                    for (int d = 0; d < 30; d++)
                    {
                        DDDraw.SetBlendAdd(1.0);
                        DDDraw.DrawSimple(subScreenTmp.ToPicture(), 0, 0);
                        DDDraw.Reset();
                    }
                    ぼかし効果.Perform(0.01);
                }
                SCommon.Swap(ref subScreen, ref subScreenTmp);
            }
            using (subScreen.Section())
            {
                DX.ClearDrawScreen();

                DDDraw.SetBright(0.0, 0.1, 0.2);
                DDDraw.DrawSimple(subScreenTmp.ToPicture(), 0, 0);
                DDDraw.Reset();

                DDFontUtils.DrawString_XCenter(x, y, text, DDFontUtils.GetFont("K\u30b4\u30b7\u30c3\u30af", 30));
            }

            double a     = 0.0;
            double aTarg = 1.0;

            foreach (DDScene scene in DDSceneUtils.Create(frameMax))
            {
                if (scene.Numer == scene.Denom - 300)
                {
                    aTarg = 0.0;
                }

                DDUtils.Approach(ref a, aTarg, 0.985);

                DDDraw.SetAlpha(a);
                DDDraw.DrawSimple(subScreen.ToPicture(), 0, 0);
                DDDraw.Reset();

                yield return(true);
            }
        }
示例#4
0
        /// <summary>
        /// レイヤ表示を実行する。
        /// ステージ番号:
        /// -- 1~9 == 各ステージ
        /// </summary>
        /// <param name="stageNo">ステージ番号</param>
        /// <param name="themeColor">このステージの印象的な色</param>
        public static void Perform(int stageNo, I3Color themeColor)
        {
            int layerNo = 10 - stageNo;

            DDCurtain.SetCurtain(0, -1.0);
            DDCurtain.SetCurtain();

            using (DDSubScreen tmpScreen = new DDSubScreen(400, 200))
            {
                foreach (DDScene scene in DDSceneUtils.Create(210))
                {
                    if (scene.Numer + 30 == scene.Denom)
                    {
                        DDCurtain.SetCurtain(30, -1.0);
                    }

                    DDCurtain.DrawCurtain();

                    int bure  = (int)(scene.Rate * scene.Rate * 20);
                    int xBure = DDUtils.Random.GetRange(-bure, bure);
                    int yBure = DDUtils.Random.GetRange(-bure, bure);
#if true
                    DDFontUtils.DrawString_XCenter(
                        DDConsts.Screen_W / 2 + xBure,
                        DDConsts.Screen_H / 2 + yBure - 50,
                        "LAYER " + layerNo,
                        DDFontUtils.GetFont("03焚火-Regular", 100)
                        );
#else
                    using (tmpScreen.Section())
                    {
                        DDPrint.SetColor(new I3Color(60, 60, 60));
                        DDPrint.SetBorder(new I3Color(255, 255, 255));
                        DDPrint.SetPrint(tmpScreen.GetSize().W / 2 - 60, tmpScreen.GetSize().H / 2 - 8);
                        DDPrint.Print("L A Y E R : " + layerNo);
                        DDPrint.Reset();
                    }
                    DDDraw.SetMosaic();
                    DDDraw.DrawBegin(
                        tmpScreen.ToPicture(),
                        DDConsts.Screen_W / 2 + xBure,
                        DDConsts.Screen_H / 2 + yBure
                        );
                    DDDraw.DrawZoom(6.0);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();
#endif

                    if (0.5 < scene.Rate)
                    {
                        const int c_max = 300;

                        for (int c = (int)(scene.Rate * scene.Rate * c_max); 0 < c; c--)
                        {
                            double c_rate = (double)c / c_max;

                            DDDraw.SetAlpha(scene.Rate * 0.5);
                            //DDDraw.SetBright(new I3Color(c, c, c)); // old
                            DDDraw.SetBright(new I3Color(
                                                 (int)(themeColor.R * c_rate),
                                                 (int)(themeColor.G * c_rate),
                                                 (int)(themeColor.B * c_rate)
                                                 ));
                            DDDraw.DrawBegin(
                                Ground.I.Picture.WhiteBox,
                                DDUtils.Random.GetInt(DDConsts.Screen_W),
                                DDUtils.Random.GetInt(DDConsts.Screen_H)
                                );
                            DDDraw.DrawSetSize(
                                DDUtils.Random.GetRange(40, (int)(400 * scene.Rate)),
                                DDUtils.Random.GetRange(20, (int)(200 * scene.Rate))
                                );
                            DDDraw.DrawEnd();
                            DDDraw.Reset();
                        }
                    }

                    DDEngine.EachFrame();
                }
            }

            DDCurtain.SetCurtain(0);
        }