public void Test01() { int rot = 0; for (; ;) { DDCurtain.DrawCurtain(); DDMouse.UpdatePos(); rot += DDMouse.Rot; DDPrint.SetPrint(); DDPrint.Print(string.Join( ", " , DDMouse.L.GetInput() , DDMouse.R.GetInput() , DDMouse.M.GetInput() , DDMouse.L.IsPound() ? 1 : 0 , DDMouse.R.IsPound() ? 1 : 0 , DDMouse.M.IsPound() ? 1 : 0 , DDMouse.X , DDMouse.Y //, DDMouse.Rot , rot )); DDEngine.EachFrame(); } }
public void Perform() { DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); if (DDMouse.L.GetInput() == 1) { break; } using (this.RoomScreen.Section()) { this.Room.DrawRoom(); } // Draw ... DDDraw.DrawSimple(this.RoomScreen.ToPicture(), 0, 0); DDEngine.EachFrame(); } }
public void Perform() { DDUtils.SetMouseDispMode(false); DDEngine.FreezeInput(10); double x = DDConsts.Screen_W / 2; double y = DDConsts.Screen_H / 2; double speed = SPEED_DEF; for (; ;) { DDMouse.UpdateMove(); x += DDMouse.MoveX * speed; y += DDMouse.MoveY * speed; DDUtils.ToRange(ref x, 0, DDConsts.Screen_W - 1); DDUtils.ToRange(ref y, 0, DDConsts.Screen_H - 1); int ix = DoubleTools.ToInt(x); int iy = DoubleTools.ToInt(y); if (DDKey.IsPound(DX.KEY_INPUT_Z)) { speed += SPEED_CHANGE_STEP; } if (DDKey.IsPound(DX.KEY_INPUT_X)) { speed -= SPEED_CHANGE_STEP; } DDUtils.ToRange(ref speed, SPEED_MIN, SPEED_MAX); if (DDMouse.L.GetInput() == -1) { break; } DDCurtain.DrawCurtain(); DDPrint.SetPrint(0, 0, 24); DDPrint.PrintLine("★マウスカーソルを奪う"); DDPrint.PrintLine("X=" + x.ToString("F3")); DDPrint.PrintLine("Y=" + y.ToString("F3")); DDPrint.PrintLine("Speed=" + speed); DDPrint.PrintLine("左クリックでメニューに戻る。"); DDPrint.PrintLine("Zキー:速度上げ"); DDPrint.PrintLine("Xキー:速度下げ"); DDDraw.SetBright(new I3Color(255, 128, 0)); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, ix, iy - CROSS_WH / 2, 1, CROSS_WH); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, ix - CROSS_WH / 2, iy, CROSS_WH, 1); DDDraw.Reset(); DDEngine.EachFrame(); } DDUtils.SetMouseDispMode(true); }
public void マウスカーソルをここへ移動() { const double MOUSE_XY_MGN = 3.0; DDMouse.X = (int)(ITEM_X + ITEM_W / 2 - MOUSE_XY_MGN); DDMouse.Y = (int)(ITEM_Y + ITEM_H / 2 - MOUSE_XY_MGN + this.SelfIndex * ITEM_Y_STEP); DDMouse.PosChanged(); }
public void Perform() { DDUtils.SetMouseDispMode(true); string line1 = ""; string line2 = ""; string line3 = ""; for (; ;) { DDMouse.UpdatePos(); if (DDMouse.L.GetInput() == 1) { if (DDUtils.IsOut(new D2Point(DDMouse.X, DDMouse.Y), new D4Rect(50, 50, 50, 16)) == false) { line1 = EditString("LINE-1 (70 bytes)", line1, 70, '-'); } else if (DDUtils.IsOut(new D2Point(DDMouse.X, DDMouse.Y), new D4Rect(50, 150, 50, 16)) == false) { line2 = EditString("LINE-2 (ASCII only, 50 bytes)", line2, 50, 'A'); } else if (DDUtils.IsOut(new D2Point(DDMouse.X, DDMouse.Y), new D4Rect(50, 250, 50, 16)) == false) { line3 = EditString("LINE-3 (DIGIT only, 10 bytes)", line3, 10, '9'); } } DDCurtain.DrawCurtain(); DX.DrawBox(0, 0, DDConsts.Screen_W, 100, DX.GetColor(60, 60, 60), 1); DX.DrawBox(0, 100, DDConsts.Screen_W, 200, DX.GetColor(60, 90, 30), 1); DX.DrawBox(0, 200, DDConsts.Screen_W, 300, DX.GetColor(60, 30, 90), 1); DDPrint.SetPrint(50, 50); DDPrint.Print("[EDIT]"); DDPrint.SetPrint(150, 50); DDPrint.Print(line1); DDPrint.SetPrint(50, 150); DDPrint.Print("[EDIT]"); DDPrint.SetPrint(150, 150); DDPrint.Print(line2); DDPrint.SetPrint(50, 250); DDPrint.Print("[EDIT]"); DDPrint.SetPrint(150, 250); DDPrint.Print(line3); DDEngine.EachFrame(); } }
private void EditMode() { DDEngine.FreezeInput(); DDUtils.SetMouseDispMode(true); for (; ;) { int lastMouseX = DDMouse.X; int lastMouseY = DDMouse.Y; DDMouse.UpdatePos(); if (DDKey.GetInput(DX.KEY_INPUT_E) == 1) { break; } if (1 <= DDKey.GetInput(DX.KEY_INPUT_LSHIFT) || 1 <= DDKey.GetInput(DX.KEY_INPUT_RSHIFT)) // シフト押下 -> 移動モード { if (1 <= DDMouse.L.GetInput()) { DDGround.Camera.X -= DDMouse.X - lastMouseX; DDGround.Camera.Y -= DDMouse.Y - lastMouseY; DDUtils.ToRange(ref DDGround.Camera.X, 0.0, this.Map.W * MapTile.WH - DDConsts.Screen_W); DDUtils.ToRange(ref DDGround.Camera.Y, 0.0, this.Map.H * MapTile.WH - DDConsts.Screen_H); DDGround.ICamera.X = DoubleTools.ToInt(DDGround.Camera.X); DDGround.ICamera.Y = DoubleTools.ToInt(DDGround.Camera.Y); } } else // 編集モード { GameEdit.EachFrame(); } DrawWall(); if (GameEdit.DisplayTileFlag) { DrawMap(); } GameEdit.Draw(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); DDUtils.SetMouseDispMode(false); }
private static bool TitleDDStartConfirm() { bool ret = false; P_TitleBackWDest = DDConsts.Screen_W; DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); if (DDMouse.L.GetInput() == 1) { int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 280, 370, 320)) == false) // はい { ret = true; break; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(520, 280, 690, 320)) == false) // いいえ { break; } } DrawWall(); DrawTitleBack(); PrintByFont.SetPrint(); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(" セーブデータを消去します。よろしいですか?"); PrintByFont.Print(""); PrintByFont.Print(" は い い い え"); DDEngine.EachFrame(); } return(ret); }
private static void TitleConfigResetPlayData() { DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); if (DDMouse.L.GetInput() == 1) { int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 280, 370, 320)) == false) // はい { // TODO SE // TODO reset play data SaveData.HasSaveData = false; // セーブデータもリセットする必要あり。 break; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(520, 280, 690, 320)) == false) // いいえ { break; } } DrawWall(); DrawTitleBack(); PrintByFont.SetPrint(); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(" プレイデータを消去します。よろしいですか?"); PrintByFont.Print(""); PrintByFont.Print(" は い い い え"); DDEngine.EachFrame(); } }
public void Perform() { DDEngine.FreezeInput(10); for (; ;) { DDMouse.UpdatePos(); if (DDUtils.IsOut(new D2Point(DDMouse.X, DDMouse.Y), new D4Rect(WARP_L, WARP_T, WARP_W, WARP_H)) == false) { DDMouse.X = WARP_DEST_X; DDMouse.Y = WARP_DEST_Y; DDMouse.ApplyPos(); } if (DDMouse.L.GetInput() == -1) { break; } DDCurtain.DrawCurtain(); DDPrint.SetPrint(0, 0, 24); DDPrint.PrintLine("★位置取得と位置設定"); DDPrint.PrintLine("X=" + DDMouse.X); DDPrint.PrintLine("Y=" + DDMouse.Y); DDPrint.PrintLine("左クリックでメニューに戻る。"); DDPrint.PrintLine("水色の領域にマウスカーソルを移動すると、黄色い十字にワープする。"); DDDraw.SetBright(new I3Color(0, 200, 200)); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, WARP_L, WARP_T, WARP_W, WARP_H); DDDraw.Reset(); DDDraw.SetBright(new I3Color(200, 200, 0)); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, WARP_DEST_X, WARP_DEST_Y - CROSS_WH / 2, 1, CROSS_WH); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, WARP_DEST_X - CROSS_WH / 2, WARP_DEST_Y, CROSS_WH, 1); DDDraw.Reset(); DDEngine.EachFrame(); } }
public void Perform() { DDEngine.FreezeInput(10); for (; ;) { DDMouse.UpdatePos(); if (DDMouse.L.GetInput() == -1) { break; } DDCurtain.DrawCurtain(); DDPrint.SetPrint(0, 0, 24); DDPrint.PrintLine("★位置取得のみ"); DDPrint.PrintLine("X=" + DDMouse.X); DDPrint.PrintLine("Y=" + DDMouse.Y); DDPrint.PrintLine("左クリックでメニューに戻る。"); DDEngine.EachFrame(); } }
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); } }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); restartCurrPage: this.CurrPage = this.Status.Scenario.Pages[this.Status.CurrPageIndex]; foreach (ScenarioCommand command in this.CurrPage.Commands) { command.Invoke(); } int dispSubtitleCharCount = 0; int dispCharCount = 0; int dispPageEndedCount = 0; bool dispFastMode = false; DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); // キー押下は 1 マウス押下は -1 で判定する。 // 入力:シナリオを進める。 if ( DDMouse.L.GetInput() == -1 || DDInput.A.GetInput() == 1 || DDKey.GetInput(DX.KEY_INPUT_SPACE) == 1 || DDKey.GetInput(DX.KEY_INPUT_RETURN) == 1 ) { if (dispPageEndedCount < NEXT_PAGE_KEY_INTERVAL) // ? ページ表示_未完了 -> ページ表示_高速化 { dispFastMode = true; } else // ? ページ表示_完了 -> 次ページ { this.Status.CurrPageIndex++; if (this.Status.Scenario.Pages.Count <= this.Status.CurrPageIndex) { break; } goto restartCurrPage; } } if ( this.CurrPage.Subtitle.Length < dispSubtitleCharCount && this.CurrPage.Text.Length < dispCharCount ) { dispPageEndedCount++; } if (dispFastMode) { dispSubtitleCharCount += 2; dispCharCount += 2; } else { if (DDEngine.ProcFrame % 2 == 0) { dispSubtitleCharCount++; } if (DDEngine.ProcFrame % 3 == 0) { dispCharCount++; } } DDUtils.ToRange(ref dispSubtitleCharCount, 0, IntTools.IMAX); DDUtils.ToRange(ref dispCharCount, 0, IntTools.IMAX); // ==== // 描画ここから // ==== this.DrawSurfaces(); // メッセージ枠 { const int h = 136; DDDraw.SetAlpha(0.9); DDDraw.DrawRect(Ground.I.Picture.MessageFrame_Message, 0, DDConsts.Screen_H - h, DDConsts.Screen_W, h); DDDraw.Reset(); } // システムボタン { const double BUTTON_L = 530.5; // 素材の幅が奇数なので n + 0.5 const double BUTTON_T = 412.5; // 素材の高さも奇数なので n + 0.5 const double BUTTON_X_STEP = 78.0; DDPicture[] buttons = new DDPicture[] { Ground.I.Picture.MessageFrame_Save, Ground.I.Picture.MessageFrame_Load, Ground.I.Picture.MessageFrame_Skip, Ground.I.Picture.MessageFrame_Auto, Ground.I.Picture.MessageFrame_Log, Ground.I.Picture.MessageFrame_Menu, //Ground.I.Picture.MessageFrame_Close, //Ground.I.Picture.MessageFrame_Config, //Ground.I.Picture.MessageFrame_QLoad, //Ground.I.Picture.MessageFrame_QSave, //Ground.I.Picture.MessageFrame_Screen, //Ground.I.Picture.MessageFrame_Title, }; for (int index = 0; index < buttons.Length; index++) { DDDraw.DrawCenter(buttons[index], BUTTON_L + index * BUTTON_X_STEP, BUTTON_T); } } // サブタイトル文字列 { int dispSubtitleLength = Math.Min(dispCharCount, this.CurrPage.Subtitle.Length); string dispSubtitle = this.CurrPage.Subtitle.Substring(0, dispSubtitleLength); DDFontUtils.DrawString(120, 320, dispSubtitle, DDFontUtils.GetFont("Kゴシック", 16)); } // シナリオのテキスト文字列 { int dispTextLength = Math.Min(dispCharCount, this.CurrPage.Text.Length); string dispText = this.CurrPage.Text.Substring(0, dispTextLength); string[] dispLines = dispText.Split('\n'); for (int index = 0; index < dispLines.Length; index++) { DDFontUtils.DrawString(10, 450 + index * 30, dispLines[index], DDFontUtils.GetFont("Kゴシック", 16), false, new I3Color(110, 100, 90)); } } DDEngine.EachFrame(); } DDCurtain.SetCurtain(30, -1.0); DDMusicUtils.Fade(); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.DrawSurfaces(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
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(); } }
private static void TitleDDStart() { double selRateContinue = 0.0; double selRateStart = 0.0; double selRateBack = 0.0; const int TGS_CONTINUE_X = DDConsts.Screen_W / 2; const int TGS_CONTINUE_Y = 150; const int TGS_START_X = DDConsts.Screen_W / 2; const int TGS_START_Y = 390; const int TGS_BACK_X = 830; const int TGS_BACK_Y = 460; returned: DDEngine.FreezeInput(); WallBokashiRateDest = 1.0; WallZRateDest = 1.0; P_TitleBackWDest = 450; for (; ;) { bool continueEnabled = SaveData.HasSaveData; // 描画 ----> DrawWall(); DrawTitleBack(); if (continueEnabled) { DDDraw.DrawBegin(Ground.I.Picture.TitleItemContinue, TGS_CONTINUE_X, TGS_CONTINUE_Y); DDDraw.DrawZoom(1.0 + selRateContinue * 0.1); DDDraw.DrawEnd(); NamedCrashMgr.AddLastDrawedCrash("CONTINUE"); } else { DDDraw.SetBright(0.6, 0.6, 0.6); DDDraw.DrawCenter(Ground.I.Picture.TitleItemContinue, TGS_CONTINUE_X, TGS_CONTINUE_Y); DDDraw.Reset(); } DDDraw.DrawBegin(Ground.I.Picture.TitleItemStart, TGS_START_X, TGS_START_Y); DDDraw.DrawZoom(1.0 + selRateStart * 0.1); DDDraw.DrawEnd(); NamedCrashMgr.AddLastDrawedCrash("START"); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnBack, TGS_BACK_X, TGS_BACK_Y); DDDraw.DrawZoom(1.0 + selRateBack * 0.15); DDDraw.DrawEnd(); NamedCrashMgr.AddLastDrawedCrash("BACK"); // <---- 描画 DDMouse.UpdatePos(); string pointingName = NamedCrashMgr.GetName(DDMouse.X, DDMouse.Y); if (pointingName == "CONTINUE") { DDUtils.Approach(ref selRateContinue, 1.0, 0.8); } else { DDUtils.Approach(ref selRateContinue, 0.0, 0.85); } if (pointingName == "START") { DDUtils.Approach(ref selRateStart, 1.0, 0.8); } else { DDUtils.Approach(ref selRateStart, 0.0, 0.85); } if (pointingName == "BACK") { DDUtils.Approach(ref selRateBack, 1.0, 0.85); } else { DDUtils.Approach(ref selRateBack, 0.0, 0.93); } DDEngine.EachFrame(); // ★★★ EachFrame if (DDMouse.L.GetInput() == 1) { if (pointingName == "BACK") { break; } if (pointingName == "START") { if (SaveData.HasSaveData) { if (TitleDDStartConfirm()) { SaveData.HasSaveData = false; TitleDDStart2(); } } else { TitleDDStart2(); } selRateContinue = 0.0; selRateStart = 0.0; selRateBack = 1.0; goto returned; } if (pointingName == "CONTINUE") { TitleDDStart2(); selRateContinue = 0.0; selRateStart = 0.0; selRateBack = 1.0; goto returned; } } } }
private static void TitleDDStart2() { WallBokashiRateDest = 0.0; WallZRateDest = 1.02; P_TitleBackWDest = 0; const int TGS_BACK_X = 830; const int TGS_BACK_Y = 460; double selRateBack = 0.0; DDEngine.FreezeInput(); for (; ;) { DrawWall(); DrawTitleBack(); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnBack, TGS_BACK_X, TGS_BACK_Y); DDDraw.DrawZoom(1.0 + selRateBack * 0.15); DDDraw.DrawEnd(); NamedCrashMgr.AddLastDrawedCrash("BACK"); // <---- 描画 DDMouse.UpdatePos(); string pointingName = NamedCrashMgr.GetName(DDMouse.X, DDMouse.Y); if (pointingName == "BACK") { DDUtils.Approach(ref selRateBack, 1.0, 0.85); } else { DDUtils.Approach(ref selRateBack, 0.0, 0.93); } DDEngine.EachFrame(); // ★★★ EachFrame if (DDMouse.L.GetInput() == 1) { if (pointingName == "BACK") { break; } int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(330, 90, 640, 360)) == false) // 入口 { SaveData.HasSaveData = true; // kari using (Game game = new Game()) { game.Room = new Room0001(); game.Perform(); } // TODO TitleMain()まで戻るべき } } } }
private static void TitleConfig() { P_TitleBackWDest = DDConsts.Screen_W; DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); if (DDUtils.IsPound(DDMouse.L.GetInput())) { int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 120, 470, 160)) == false) // [960x540] { DDMain.SetScreenSize(960, 540); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(530, 120, 800, 160)) == false) // [1440x810] { DDMain.SetScreenSize(1440, 810); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 160, 470, 200)) == false) // [1920x1080] { DDMain.SetScreenSize(1920, 1080); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(530, 160, 800, 200)) == false) // [フルスクリーン] { int w = DDGround.MonitorRect.W; int h = (DDConsts.Screen_H * DDGround.MonitorRect.W) / DDConsts.Screen_W; if (DDGround.MonitorRect.H < h) { h = DDGround.MonitorRect.H; w = (DDConsts.Screen_W * DDGround.MonitorRect.H) / DDConsts.Screen_H; if (DDGround.MonitorRect.W < w) { throw new DDError(); } } DDMain.SetScreenSize(DDGround.MonitorRect.W, DDGround.MonitorRect.H); DDGround.RealScreenDraw_L = (DDGround.MonitorRect.W - w) / 2; DDGround.RealScreenDraw_T = (DDGround.MonitorRect.H - h) / 2; DDGround.RealScreenDraw_W = w; DDGround.RealScreenDraw_H = h; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(400, 240, 530, 280)) == false) { DDGround.MusicVolume += 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(550, 240, 690, 280)) == false) { DDGround.MusicVolume -= 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(700, 240, 900, 280)) == false) { DDGround.MusicVolume = DDConsts.DefaultVolume; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(400, 320, 530, 360)) == false) { DDGround.SEVolume += 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(550, 320, 690, 360)) == false) { DDGround.SEVolume -= 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(700, 320, 900, 360)) == false) { DDGround.SEVolume = DDConsts.DefaultVolume; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 400, 600, 440)) == false) { TitleConfigResetPlayData(); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(830, 480, 930, 520)) == false) { break; } DDGround.MusicVolume = DoubleTools.ToRange(DDGround.MusicVolume, 0.0, 1.0); DDGround.SEVolume = DoubleTools.ToRange(DDGround.SEVolume, 0.0, 1.0); } DrawWall(); DrawTitleBack(); PrintByFont.SetPrint(); PrintByFont.Print(""); PrintByFont.Print(" 設定"); PrintByFont.Print(""); PrintByFont.Print(" 画面サイズ [960x540] [1440x810]"); PrintByFont.Print(" [1920x1080] [フルスクリーン]"); PrintByFont.Print(""); PrintByFont.Print(string.Format(" BGM音量 {0:F2} [上げる] [下げる] [デフォルト]", DDGround.MusicVolume)); PrintByFont.Print(""); PrintByFont.Print(string.Format(" SE音量 {0:F2} [上げる] [下げる] [デフォルト]", DDGround.SEVolume)); PrintByFont.Print(""); PrintByFont.Print(" プレイデータリセット"); PrintByFont.Print(""); PrintByFont.Print(" [戻る]"); DDEngine.EachFrame(); } }