public void Draw() { blurEffect.WriteRenderTarget(renderer.FogManager.CurrentColor()); townScene.Draw(); //背景は前のシーンを描画 blurEffect.ReleaseRenderTarget(); blurEffect.Draw(renderer); renderer.Begin(); backWindow.Draw(); renderer.DrawString("戻る", backButton.ButtonCenterVector(), Color.White, new Vector2(1, 1), 1.0f, true, true); leftWindow.Draw(); rightWindow.Draw(); messegeWindow.Draw(); equipmentWindow.Draw(); consumptionWindow.Draw(); rightPageRightWindow.Draw(); rightPageLeftWindow.Draw(); leftPageRightWindow.Draw(); leftPageLeftWindow.Draw(); if (mode == DepotModeType.select) { renderer.DrawString("どっちに用があるんだい?", messegeWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); renderer.DrawString("装備品", equipmentButton.ButtonCenterVector(), Color.White, new Vector2(1, 1), 1.0f, true, true); renderer.DrawString("消費アイテム", consumptionButton.ButtonCenterVector(), Color.White, new Vector2(1, 1), 1.0f, true, true); } if (mode == DepotModeType.equipment) { renderer.DrawString("倉庫(" + depotNowNum + "/" + depotMaxNum + ")", new Vector2(windowWidth / 2 + 64, 64), new Vector2(1, 1), Color.White); } if (mode == DepotModeType.consumption || mode == DepotModeType.equipment) { renderer.DrawString("バッグ(" + bagNowNum + "/" + bagMaxNum + ")", new Vector2(64, 64), new Vector2(1, 1), Color.White); renderer.DrawString("倉庫", new Vector2(windowWidth / 2 + 64, 64), new Vector2(1, 1), Color.White); renderer.DrawString("ページ(" + leftPage + "/" + leftMaxPage + ")", new Vector2(windowWidth / 4 - 48, windowHeight - 96), new Vector2(1, 1), Color.White); renderer.DrawString("ページ(" + rightPage + "/" + rightMaxPage + ")", new Vector2(windowWidth - windowWidth / 4 - 48, windowHeight - 96), new Vector2(1, 1), Color.White); if (leftPageLeftWindow.CurrentState()) { renderer.DrawString("←", leftPageLeftWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } if (leftPageRightWindow.CurrentState()) { renderer.DrawString("→", leftPageRightWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } if (rightPageLeftWindow.CurrentState()) { renderer.DrawString("←", rightPageLeftWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } if (rightPageRightWindow.CurrentState()) { renderer.DrawString("→", rightPageRightWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } renderer.DrawString("アイテム名", new Vector2(64, 64 + 32), new Vector2(1, 1), Color.White); renderer.DrawString("タイプ", new Vector2(224, 64 + 32), new Vector2(1, 1), Color.White); renderer.DrawString("アイテム名", new Vector2(windowWidth / 2 + 64, 64 + 32), new Vector2(1, 1), Color.White); renderer.DrawString("タイプ", new Vector2(windowWidth / 2 + 224, 64 + 32), new Vector2(1, 1), Color.White); if (mode == DepotModeType.consumption) { renderer.DrawString("所持数", new Vector2(windowWidth / 2 + 320, 64 + 32), new Vector2(1, 1), Color.White); } //左側のリストのアイテムの描画 for (int i = 0; i < leftPageItems.Count; i++) { leftWindows[i].Draw(); //アイテム名表示 if (leftPageItems[i] is ConsumptionItem) { if (((ConsumptionItem)leftPageItems[i]).GetTypeText() != "矢") { renderer.DrawString(leftPageItems[i].GetItemName(), leftWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } else { renderer.DrawString(leftPageItems[i].GetItemName() + "x" + ((ConsumptionItem)leftPageItems[i]).GetStack(), leftWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } } else { renderer.DrawString(leftPageItems[i].GetItemName(), leftWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } //アイテムタイプの表示 string type; if (leftPageItems[i] is WeaponItem) { type = ((WeaponItem)leftPageItems[i]).GetWeaponType().ToString(); } else if (leftPageItems[i] is ProtectionItem) { type = ((ProtectionItem)leftPageItems[i]).GetProtectionType().ToString(); } else if (leftPageItems[i] is AccessaryItem) { type = "装飾品"; } else { type = ((ConsumptionItem)leftPageItems[i]).GetTypeText(); } renderer.DrawString(type, leftWindows[i].GetOffsetPosition() + new Vector2(160, 0), new Vector2(1, 1), Color.White); } //右側のリストのアイテムの描画 for (int i = 0; i < rightPageItems.Count; i++) { rightWindows[i].Draw(); //アイテム名の表示 renderer.DrawString(rightItems[i + (rightPage - 1) * 20].GetItemName(), rightWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); //アイテムタイプの表示 string type; if (rightItems[i + (rightPage - 1) * 20] is WeaponItem) { type = ((WeaponItem)rightItems[i + (rightPage - 1) * 20]).GetWeaponType().ToString(); } else if (rightItems[i + (rightPage - 1) * 20] is ProtectionItem) { type = ((ProtectionItem)rightItems[i + (rightPage - 1) * 20]).GetProtectionType().ToString(); } else if (rightItems[i + (rightPage - 1) * 20] is AccessaryItem) { type = "装飾品"; } else { type = ((ConsumptionItem)rightItems[i + (rightPage - 1) * 20]).GetTypeText(); } renderer.DrawString(type, rightWindows[i].GetOffsetPosition() + new Vector2(160, 0), new Vector2(1, 1), Color.White); //所持数の表示(消費アイテムのみ) if (mode == DepotModeType.consumption) { if (consumptions.ContainsKey(rightItems[i + (rightPage - 1) * 20].GetItemID())) { renderer.DrawString(consumptions[rightItems[i + (rightPage - 1) * 20].GetItemID()].ToString(), rightWindows[i].GetOffsetPosition() + new Vector2(256, 0), new Vector2(1, 1), Color.White); } } } //アイテムの詳細表示 if (isHintDraw) { renderer.DrawTexture("fade", hintInfo.Position + new Vector2(-10, -15), new Vector2(420, 100), 0.75f); hintInfo.Draw(hintItem, 1.0f); } //メッセージ関連 if (isBagMaxMessaga) { renderer.DrawString("バッグがいっぱいです。", new Vector2(320, windowHeight / 2), new Vector2(2, 2), Color.Red); } if (isDepotMaxMessaga && mode == DepotModeType.equipment) { renderer.DrawString("倉庫がいっぱいです。", new Vector2(320, windowHeight / 2), new Vector2(2, 2), Color.Red); } } renderer.End(); }
public void DrawEquip() { buttonWindow.Draw(); rightPageRightWindow.Draw(); rightPageLeftWindow.Draw(); leftPageRightWindow.Draw(); leftPageLeftWindow.Draw(); renderer.DrawString(text, buttonPosition, new Vector2(1, 1), Color.White); if (modeType == ModeType.Buy) { renderer.DrawString("バッグ(" + currentNum + "/" + maxNum + ")", new Vector2(windowWidth - 240, 64), new Vector2(1, 1), Color.White); renderer.DrawString("所持金 : " + playerInventory.CurrentMoney(), new Vector2(windowWidth / 2 + 120, windowHeight - 128 + 6), new Vector2(1, 1), Color.White); } renderer.DrawString("ページ(" + leftPage + "/" + leftMaxPage + ")", new Vector2(windowWidth / 4 - 48, windowHeight - 96), new Vector2(1, 1), Color.White); renderer.DrawString("ページ(" + rightPage + "/" + rightMaxPage + ")", new Vector2(windowWidth - windowWidth / 4 - 48, windowHeight - 96), new Vector2(1, 1), Color.White); if (leftPageLeftWindow.CurrentState()) { renderer.DrawString("←", leftPageLeftWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } if (leftPageRightWindow.CurrentState()) { renderer.DrawString("→", leftPageRightWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } if (rightPageLeftWindow.CurrentState()) { renderer.DrawString("←", rightPageLeftWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } if (rightPageRightWindow.CurrentState()) { renderer.DrawString("→", rightPageRightWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } renderer.DrawString("アイテム名", new Vector2(64, 64 + 32), new Vector2(1, 1), Color.White); if (modeType == ModeType.Buy) { renderer.DrawString("値段", new Vector2(224, 64 + 32), new Vector2(1, 1), Color.White); } else if (modeType == ModeType.Sell) { renderer.DrawString("買取額", new Vector2(224, 64 + 32), new Vector2(1, 1), Color.White); } renderer.DrawString("タイプ", new Vector2(320, 64 + 32), new Vector2(1, 1), Color.White); //左側のリストのアイテムの描画 for (int i = 0; i < leftPageItems.Count; i++) { leftWindows[i].Draw(); //アイテム名表示 if (leftPageItems[i] is ConsumptionItem) { if (((ConsumptionItem)leftPageItems[i]).GetTypeText() != "矢") { renderer.DrawString(leftPageItems[i].GetItemName(), leftWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } else { renderer.DrawString(leftPageItems[i].GetItemName() + "x" + ((ConsumptionItem)leftPageItems[i]).GetStack(), leftWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } } else { renderer.DrawString(leftPageItems[i].GetItemName(), leftWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } if (modeType == ModeType.Buy) { renderer.DrawString(leftPageItems[i].GetItemPrice().ToString(), leftWindows[i].GetOffsetPosition() + new Vector2(160, 0), new Vector2(1, 1), Color.White); } else if (modeType == ModeType.Sell) { renderer.DrawString((leftPageItems[i].GetItemPrice() / 2).ToString(), leftWindows[i].GetOffsetPosition() + new Vector2(160, 0), new Vector2(1, 1), Color.White); } string type; if (leftPageItems[i] is WeaponItem) { type = ((WeaponItem)leftPageItems[i]).GetWeaponType().ToString(); } else if (leftPageItems[i] is ProtectionItem) { type = ((ProtectionItem)leftPageItems[i]).GetProtectionType().ToString(); } else if (leftPageItems[i] is AccessaryItem) { type = "装飾品"; } else { type = ((ConsumptionItem)leftPageItems[i]).GetTypeText(); } renderer.DrawString(type, leftWindows[i].GetOffsetPosition() + new Vector2(256, 0), new Vector2(1, 1), Color.White); } //右側のリストのアイテムの描画 for (int i = 0; i < rightPageItems.Count; i++) { rightWindows[i].Draw(); if (rightPageItems[i] is ConsumptionItem) { if (((ConsumptionItem)rightPageItems[i]).GetTypeText() != "矢") { renderer.DrawString(rightPageItems[i].GetItemName(), rightWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } else { renderer.DrawString(rightPageItems[i].GetItemName() + "x" + ((ConsumptionItem)rightPageItems[i]).GetStack(), rightWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } } else { renderer.DrawString(rightPageItems[i].GetItemName(), rightWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } if (modeType == ModeType.Buy) { renderer.DrawString(rightPageItems[i].GetItemPrice().ToString(), rightWindows[i].GetOffsetPosition() + new Vector2(160, 0), new Vector2(1, 1), Color.White); } else if (modeType == ModeType.Sell) { renderer.DrawString((rightPageItems[i].GetItemPrice() / 2).ToString(), rightWindows[i].GetOffsetPosition() + new Vector2(160, 0), new Vector2(1, 1), Color.White); } string type; if (rightPageItems[i] is WeaponItem) { type = ((WeaponItem)rightPageItems[i]).GetWeaponType().ToString(); } else if (rightPageItems[i] is ProtectionItem) { type = ((ProtectionItem)rightPageItems[i]).GetProtectionType().ToString(); } else if (rightPageItems[i] is AccessaryItem) { type = "装飾品"; } else { type = ((ConsumptionItem)rightPageItems[i]).GetTypeText(); } renderer.DrawString(type, rightWindows[i].GetOffsetPosition() + new Vector2(256, 0), new Vector2(1, 1), Color.White); } //アイテムの詳細表示 if (modeType == ModeType.Sell) { if (isHintDraw) { renderer.DrawTexture("fade", hintInfo.Position + new Vector2(-10, -15), new Vector2(420, 100), 0.75f); hintInfo.Draw(hintItem, 1.0f); } } //メッセージ関連 messegeWindow.Draw(); if (isInventoryFullMessege) { renderer.DrawString("バッグにはいりきりません。", new Vector2(320, windowHeight / 2), new Vector2(2, 2), Color.Red); } if (isNoMoney) { renderer.DrawString("所持金が足りません。", new Vector2(320, windowHeight / 2), new Vector2(2, 2), Color.Red); } renderer.DrawString("合計金額 : " + totalPrice, new Vector2(windowWidth - 240, windowHeight - 128 + 6), new Vector2(1, 1), Color.White); }
public void Draw() { blurEffect.WriteRenderTarget(renderer.FogManager.CurrentColor()); townScene.Draw(); //背景は前のシーンを描画 blurEffect.ReleaseRenderTarget(); blurEffect.Draw(renderer); renderer.Begin(); backWindow.Draw(); renderer.DrawString("戻る", backButton.ButtonCenterVector(), Color.White, new Vector2(1, 1), 1.0f, true, true); upgradeWindow.Draw(); leftWindow.Draw(); rightWindow.Draw(); leftPageRightWindow.Draw(); leftPageLeftWindow.Draw(); renderer.DrawString("バッグ", new Vector2(64, 64), new Vector2(1, 1), Color.White); renderer.DrawString("アイテム名", new Vector2(64, 64 + 32), new Vector2(1, 1), Color.White); renderer.DrawString("タイプ", new Vector2(224, 64 + 32), new Vector2(1, 1), Color.White); renderer.DrawString("ページ(" + leftPage + "/" + leftMaxPage + ")", new Vector2(windowWidth / 4 - 48, windowHeight - 96), new Vector2(1, 1), Color.White); if (leftPageLeftWindow.CurrentState()) { renderer.DrawString("←", leftPageLeftWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } if (leftPageRightWindow.CurrentState()) { renderer.DrawString("→", leftPageRightWindow.GetCenter(), Color.White, new Vector2(1, 1), 1.0f, true, true); } //左側のリストのアイテムの描画 for (int i = 0; i < leftPageItems.Count; i++) { leftWindows[i].Draw(); //アイテム名表示 if (leftPageItems[i] is WeaponItem) { renderer.DrawString(leftPageItems[i].GetItemName() + "+" + ((WeaponItem)leftPageItems[i]).GetReinforcement(), leftWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } else { renderer.DrawString(leftPageItems[i].GetItemName() + "+" + ((ProtectionItem)leftPageItems[i]).GetReinforcement(), leftWindows[i].GetOffsetPosition(), new Vector2(1, 1), Color.White); } //アイテムタイプの表示 string type; if (leftPageItems[i] is WeaponItem) { type = ((WeaponItem)leftPageItems[i]).GetWeaponType().ToString(); } else if (leftPageItems[i] is ProtectionItem) { type = ((ProtectionItem)leftPageItems[i]).GetProtectionType().ToString(); } else { type = ((ConsumptionItem)leftPageItems[i]).GetTypeText(); } renderer.DrawString(type, leftWindows[i].GetOffsetPosition() + new Vector2(160, 0), new Vector2(1, 1), Color.White); } //右側の表示 if (isSelect) { //強化ボタン表示 renderer.DrawString("強化", upgradeButton.ButtonCenterVector(), Color.White, new Vector2(2, 2), 1.0f, true, true); //選択されたアイテム renderer.DrawString("強化前", new Vector2(windowWidth / 2 + 64, 64), new Vector2(1, 1), Color.White); selectItemInfoUI.Draw(selectItem, 1.0f); //選択されたアイテムの強化後 if (!isBiggest) { renderer.DrawString("強化後", new Vector2(windowWidth / 2 + 64, 192 + 32), new Vector2(1, 1), Color.White); upgradeItemInfoUI.Draw(upgradeItem, 1.0f); } if (!isBiggest) { //必要素材 renderer.DrawString("必要な素材", new Vector2(windowWidth / 2 + 64, 192 + 192), new Vector2(1, 1), Color.White); renderer.DrawString("(所持数 / 必要数)", new Vector2(windowWidth / 2 + 160, 192 + 192), new Vector2(1, 1), Color.White); int num = 0; foreach (int id in materialItems.Keys) { num++; if (consumptions.Keys.Contains(id)) { renderer.DrawString(itemManager.GetConsuptionItem(id).GetItemName() + "(" + consumptions[id] + "/" + materialItems[id] + ")", new Vector2(windowWidth / 2 + 64, 160 + 224 + 32 * num), new Vector2(1, 1), Color.White); } else { renderer.DrawString(itemManager.GetConsuptionItem(id).GetItemName() + "(0/" + materialItems[id] + ")", new Vector2(windowWidth / 2 + 64, 160 + 224 + 32 * num), new Vector2(1, 1), Color.White); } } //お金 renderer.DrawString("消費金額 : " + useMoney, rightWindow.GetLeftUnder() + new Vector2(0, -32), new Vector2(1, 1), Color.White); } } messegeWindow.Draw(); if (isBiggest || !isEnough || !isMoney) { upgradeWindow.Draw(); } string messageText = "noMessage"; if (isNotEnoughMessage) { messageText = "素材が足りていません"; } if (isNoMoneyMessage) { if (messageText == "noMessage") { messageText = "お金が足りていません"; } else { messageText = "素材とお金が足りていません。"; } } if (isBiggestMessage) { messageText = "レベルが最大です。"; } if (messageText != "noMessage") { renderer.DrawString(messageText, messegeWindow.GetCenter(), Color.Red, new Vector2(2, 2), 1.0f, true, true); } renderer.End(); }