Ejemplo n.º 1
0
            public override IEnumerable <bool> E_Task()
            {
                DDPicture picture = Ground.I.Picture.Title;

                double slideRate = 0.0;
                double leaveRate = 0.0;
                double z         = 1.0;

                for (; ;)
                {
                    DDUtils.Approach(ref slideRate, 1.0, 0.9999);
                    DDUtils.Approach(ref leaveRate, this.TopMenuLeaved ? 1.0 : 0.0, 0.95);
                    DDUtils.Approach(ref z, this.TopMenuLeaved ? 1.02 : 1.0, 0.9);

                    D4Rect drawRect = DDUtils.AdjustRectExterior(
                        picture.GetSize().ToD2Size(),
                        new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H),
                        slideRate
                        );

                    DDDraw.DrawBeginRect(Ground.I.Picture.Title, drawRect.L, drawRect.T, drawRect.W, drawRect.H);
                    DDDraw.DrawZoom(z);
                    DDDraw.DrawEnd();

                    if (0.01 < leaveRate)
                    {
                        ぼかし効果.Perform(leaveRate);
                        DDCurtain.DrawCurtain(-0.6 * leaveRate);
                    }
                    yield return(true);
                }
            }
Ejemplo n.º 2
0
        protected override IEnumerable <bool> E_Draw()
        {
            DDGround.EL.Add(SCommon.Supplier(Effects.バズーカ発射(this.X, this.Y)));             // 発射エフェクト

            for (; ;)
            {
                this.X += 24.0 * (this.FacingLeft ? -1 : 1);

                DDDraw.DrawBeginRect(
                    Ground.I.Picture.Dummy,
                    this.X - 12.0 - DDGround.ICamera.X,
                    this.Y - 4.0 - DDGround.ICamera.Y,
                    24.0,
                    8.0
                    );
                DDDraw.DrawEnd();

                this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 6.0);

                yield return(true);
            }
        }
Ejemplo n.º 3
0
        public override IEnumerable <bool> E_Draw()
        {
            Game.I.SkipMode = false;

            for (; ;)
            {
                //Game.I.CancelSkipAutoMode();

                if (
                    this.Options.Count < GameConsts.SELECT_OPTION_MIN ||
                    this.Options.Count > GameConsts.SELECT_OPTION_MAX
                    )
                {
                    throw new DDError("選択肢の個数に問題があります。");
                }

                // ---- 入力ここから

                if (!Game.I.BacklogMode)
                {
                    int moving = 0;

                    if (DDInput.DIR_8.IsPound())
                    {
                        moving = -1;
                    }

                    if (DDInput.DIR_2.IsPound())
                    {
                        moving = 1;
                    }

                    if (moving != 0)
                    {
                        int optIndex = this.GetMouseFocusedIndex();

                        if (optIndex == -1)
                        {
                            optIndex = 0;
                        }
                        else
                        {
                            optIndex += this.Options.Count + moving;
                            optIndex %= this.Options.Count;
                        }

                        DDMouse.X =
                            GameConsts.SELECT_FRAME_L +
                            Ground.I.Picture.MessageFrame_Button2.Get_W() * 2 -
                            10;
                        DDMouse.Y =
                            GameConsts.SELECT_FRAME_T + GameConsts.SELECT_FRAME_T_STEP * optIndex +
                            Ground.I.Picture.MessageFrame_Button2.Get_H() * 2 -
                            10;

                        DDMouse.PosChanged();
                    }
                }

                // ---- ここから描画

                if (!Hide)
                {
                    for (int index = 0; index < GameConsts.SELECT_FRAME_NUM; index++)
                    {
                        DDPicture picture = Ground.I.Picture.MessageFrame_Button;

                        if (index < this.Options.Count)
                        {
                            picture = Ground.I.Picture.MessageFrame_Button2;

                            if (this.Options[index].MouseFocused)
                            {
                                picture = Ground.I.Picture.MessageFrame_Button3;
                            }
                        }

                        DDDraw.DrawBeginRect(
                            picture,
                            GameConsts.SELECT_FRAME_L,
                            GameConsts.SELECT_FRAME_T + GameConsts.SELECT_FRAME_T_STEP * index,
                            picture.Get_W() * 2.0,
                            picture.Get_H() * 2.0
                            );
                        DDCrash drawedCrash = DDDraw.DrawGetCrash();
                        DDDraw.DrawEnd();

                        // フォーカスしている選択項目を再設定
                        {
                            if (index < this.Options.Count)
                            {
                                bool mouseIn = drawedCrash.IsCrashed(DDCrashUtils.Point(new D2Point(DDMouse.X, DDMouse.Y)));

                                this.Options[index].MouseFocused = mouseIn;
                            }
                        }
                    }
                    for (int index = 0; index < this.Options.Count; index++)
                    {
                        const int title_x = 160;
                        const int title_y = 56;

                        DDFontUtils.DrawString(
                            GameConsts.SELECT_FRAME_L + title_x,
                            GameConsts.SELECT_FRAME_T + GameConsts.SELECT_FRAME_T_STEP * index + title_y,
                            this.Options[index].Title,
                            DDFontUtils.GetFont("Kゴシック", 32),
                            false,
                            new I3Color(110, 100, 90)
                            );
                    }
                }

                // 隠しているなら選択出来ない。
                if (Hide)
                {
                    foreach (OptionInfo option in this.Options)
                    {
                        option.MouseFocused = false;
                    }
                }

                yield return(true);
            }
        }
Ejemplo n.º 4
0
        public static void TitleMain()
        {
            WorkScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H);

            foreach (DDScene scene in DDSceneUtils.Create(30))
            {
                DDCurtain.DrawCurtain();
                DDEngine.EachFrame();
            }
            foreach (DDScene scene in DDSceneUtils.Create(30))
            {
                double a = -1.0 + scene.Rate;

                DDDraw.DrawBegin(Ground.I.Picture.Logo, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0);
                DDDraw.DrawZoom(1.0 + a * a * 0.1);
                DDDraw.DrawEnd();
                //DDDraw.DrawSimple(Ground.I.Picture.Logo, 0, 0);

                DDCurtain.DrawCurtain(a);
                DDEngine.EachFrame();
            }
            foreach (DDScene scene in DDSceneUtils.Create(60))
            {
                DDDraw.DrawSimple(Ground.I.Picture.Logo, 0, 0);
                DDEngine.EachFrame();
            }
            foreach (DDScene scene in DDSceneUtils.Create(30))
            {
                double a = -scene.Rate;

                DDDraw.DrawBegin(Ground.I.Picture.Logo, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0);
                DDDraw.DrawZoom(1.0 + a * a * 0.1);
                DDDraw.DrawEnd();
                //DDDraw.DrawSimple(Ground.I.Picture.Logo, 0, 0);

                DDCurtain.DrawCurtain(a);
                DDEngine.EachFrame();
            }
            foreach (DDScene scene in DDSceneUtils.Create(30))
            {
                DDCurtain.DrawCurtain();
                DDEngine.EachFrame();
            }

            const int TITLE_BTN_START_X = 130;
            const int TITLE_BTN_START_Y = 460;

            const int TITLE_BTN_CONFIG_X = 830;
            const int TITLE_BTN_CONFIG_Y = 70;

            const int TITLE_BTN_EXIT_X = 830;
            const int TITLE_BTN_EXIT_Y = 460;

            {
                double   a           = 0.0;
                double   z           = 1.3;
                bool     titleBackOn = false;
                double   titleBackA  = 0.0;
                double   titleBackZ  = 0.1;
                bool     titleOn     = false;
                double   titleA      = 0.0;
                double   titleZ      = 1.3;
                bool[]   titleBtnsOn = new bool[] { false, false, false };
                double[] titleBtnsA  = new double[3] {
                    0, 0, 0
                };
                double[] titleBtnsZ = new double[3] {
                    1.05, 1.1, 1.15
                };

                foreach (DDScene scene in DDSceneUtils.Create(120))
                {
                    if (scene.Numer == 30)
                    {
                        titleBackOn = true;
                    }

                    if (scene.Numer == 60)
                    {
                        titleOn = true;
                    }

                    if (scene.Numer == 90)
                    {
                        titleBtnsOn[0] = true;
                    }

                    if (scene.Numer == 100)
                    {
                        titleBtnsOn[1] = true;
                    }

                    if (scene.Numer == 110)
                    {
                        titleBtnsOn[2] = true;
                    }

                    DDCurtain.DrawCurtain();

                    // Wall >

                    DDSubScreenUtils.ChangeDrawScreen(WorkScreen.GetHandle());

                    DDDraw.SetAlpha(a);
                    DDDraw.DrawBegin(Ground.I.Picture.TitleWall, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                    DDDraw.DrawZoom(z);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    DX.GraphFilter(WorkScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000);                     // 1
                    DX.GraphFilter(WorkScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000);                     // 2

                    DDSubScreenUtils.RestoreDrawScreen();

                    DDDraw.DrawSimple(DDPictureLoaders2.Wrapper(WorkScreen), 0, 0);

                    // < Wall

                    DDDraw.SetAlpha(titleBackA);
                    DDDraw.SetBright(0, 0, 0);
                    DDDraw.DrawBeginRect(DDGround.GeneralResource.WhiteBox, TITLE_BACK_L, TITLE_BACK_T, TITLE_BACK_W, TITLE_BACK_H);
                    DDDraw.DrawZoom_X(titleBackZ);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    DDDraw.SetAlpha(titleA);
                    DDDraw.DrawBegin(Ground.I.Picture.Title, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                    DDDraw.DrawZoom(titleZ);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    DDDraw.SetAlpha(titleBtnsA[0]);
                    DDDraw.DrawBegin(Ground.I.Picture.TitleBtnStart, TITLE_BTN_START_X, TITLE_BTN_START_Y);
                    DDDraw.DrawZoom(titleBtnsZ[0]);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    DDDraw.SetAlpha(titleBtnsA[1]);
                    DDDraw.DrawBegin(Ground.I.Picture.TitleBtnConfig, TITLE_BTN_CONFIG_X, TITLE_BTN_CONFIG_Y);
                    DDDraw.DrawZoom(titleBtnsZ[1]);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    DDDraw.SetAlpha(titleBtnsA[2]);
                    DDDraw.DrawBegin(Ground.I.Picture.TitleBtnExit, TITLE_BTN_EXIT_X, TITLE_BTN_EXIT_Y);
                    DDDraw.DrawZoom(titleBtnsZ[2]);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    DDUtils.Approach(ref a, 1.0, 0.97);
                    DDUtils.Approach(ref z, 1.0, 0.95);

                    if (titleBackOn)
                    {
                        DDUtils.Approach(ref titleBackA, TITLE_BACK_A, 0.95);
                        DDUtils.Approach(ref titleBackZ, 1.0, 0.9);
                    }
                    if (titleOn)
                    {
                        DDUtils.Approach(ref titleA, 1.0, 0.93);
                        DDUtils.Approach(ref titleZ, 1.0, 0.8);
                    }
                    for (int c = 0; c < 3; c++)
                    {
                        if (titleBtnsOn[c])
                        {
                            DDUtils.Approach(ref titleBtnsA[c], 1.0, 0.77);
                            DDUtils.Approach(ref titleBtnsZ[c], 1.0, 0.73);
                        }
                    }
                    DDEngine.EachFrame();
                }
            }

            {
                double selRateStart  = 0.0;
                double selRateConfig = 0.0;
                double selRateExit   = 0.0;

returned:
                DDEngine.FreezeInput();

                WallBokashiRateDest = 1.0;
                P_TitleBackWDest    = TITLE_BACK_W;

                for (; ;)
                {
                    DrawWall();
                    DrawTitleBack();

                    DDDraw.DrawCenter(Ground.I.Picture.Title, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);

                    DDDraw.DrawBegin(Ground.I.Picture.TitleBtnStart, TITLE_BTN_START_X, TITLE_BTN_START_Y);
                    DDDraw.DrawZoom(1.0 + selRateStart * 0.2);
                    DDDraw.DrawEnd();
                    NamedCrashMgr.AddLastDrawedCrash("START");
                    DDDraw.DrawBegin(Ground.I.Picture.TitleBtnConfig, TITLE_BTN_CONFIG_X, TITLE_BTN_CONFIG_Y);
                    DDDraw.DrawZoom(1.0 + selRateConfig * 0.15);
                    DDDraw.DrawEnd();
                    NamedCrashMgr.AddLastDrawedCrash("CONFIG");
                    DDDraw.DrawBegin(Ground.I.Picture.TitleBtnExit, TITLE_BTN_EXIT_X, TITLE_BTN_EXIT_Y);
                    DDDraw.DrawZoom(1.0 + selRateExit * 0.15);
                    DDDraw.DrawEnd();
                    NamedCrashMgr.AddLastDrawedCrash("EXIT");

                    // <---- 描画

                    DDMouse.UpdatePos();

                    string pointingName = NamedCrashMgr.GetName(DDMouse.X, DDMouse.Y);

                    if (pointingName == "START")
                    {
                        DDUtils.Approach(ref selRateStart, 1.0, 0.85);
                    }
                    else
                    {
                        DDUtils.Approach(ref selRateStart, 0.0, 0.9);
                    }

                    if (pointingName == "CONFIG")
                    {
                        DDUtils.Approach(ref selRateConfig, 1.0, 0.9);
                    }
                    else
                    {
                        DDUtils.Approach(ref selRateConfig, 0.0, 0.93);
                    }

                    if (pointingName == "EXIT")
                    {
                        DDUtils.Approach(ref selRateExit, 1.0, 0.9);
                    }
                    else
                    {
                        DDUtils.Approach(ref selRateExit, 0.0, 0.93);
                    }

                    DDEngine.EachFrame();                     // ★★★ EachFrame

                    if (DDMouse.L.GetInput() == 1)
                    {
                        if (pointingName == "EXIT")
                        {
                            break;
                        }

                        if (pointingName == "CONFIG")
                        {
                            TitleConfig();
                            goto returned;
                        }
                        if (pointingName == "START")
                        {
                            TitleDDStart();

                            selRateStart = 0.0;
                            selRateExit  = 1.0;

                            goto returned;
                        }
                    }
                }
            }

            DDCurtain.SetCurtain(30, -1.0);
            DDMusicUtils.Fade();

            foreach (DDScene scene in DDSceneUtils.Create(40))
            {
                DrawWall();
                DDEngine.EachFrame();
            }
        }