public override void OnManagedリソースの作成() // OPTIONと画像以外共通 { if (base.b活性化してる) { this.tx背景 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\4_background.jpg"), false); this.tx上部パネル = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\4_header panel.png")); this.tx下部パネル = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\4_footer panel.png")); this.txMenuカーソル = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenConfig menu cursor.png")); prvFont = new CPrivateFastFont(CSkin.Path(@"Graphics\fonts\mplus-1p-heavy.ttf"), 20); string[] strMenuItem = { "System", "Drums", "Exit" }; txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; for (int i = 0; i < strMenuItem.Length; i++) { Bitmap bmpStr; bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black); txMenuItemLeft[i, 0] = CDTXMania.tテクスチャの生成(bmpStr, false); bmpStr.Dispose(); bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black, Color.Yellow, Color.OrangeRed); txMenuItemLeft[i, 1] = CDTXMania.tテクスチャの生成(bmpStr, false); bmpStr.Dispose(); } if (this.bメニューにフォーカス中) { this.t説明文パネルに現在選択されているメニューの説明を描画する(); } else { this.t説明文パネルに現在選択されている項目の説明を描画する(); } base.OnManagedリソースの作成(); } }
private void ConditionallyInitializePrvFont() { if (prvFont == null) { prvFont = new CPrivateFastFont(CSkin.Path(@"Graphics\ipag.ttf"), 18); } }
public override void OnManagedCreateResources() { if (base.bNotActivated) { return; } //string strファイルの相対パス = Path.Combine("Graphics\\fonts", CDTXMania.app.Resources.Explanation("strCfgSelectMusicInformationFontFileName")); //prvf入力文字列 = new CPrivateFastFont(CSkin.Path(strファイルの相対パス), 20); //prvf説明 = new CPrivateFastFont(CSkin.Path(strファイルの相対パス), 16); prvf入力文字列 = new CPrivateFastFont(new FontFamily(CDTXMania.ConfigIni.str選曲リストフォント), 20, FontStyle.Regular); prvf説明 = new CPrivateFastFont(new FontFamily(CDTXMania.ConfigIni.str選曲リストフォント), 14, FontStyle.Regular); t基本位置に応じて文字の描画範囲を設定する(); t背景テクスチャを生成(); using (Bitmap bitmap = new Bitmap(rectパネル基本位置.Width, 350)) { using (Graphics graphics = Graphics.FromImage(bitmap)) { graphics.FillRectangle(new SolidBrush(Color.FromArgb(160, Color.Black)), 0, 0, bitmap.Width, bitmap.Height); StringBuilder stringBuilder = new StringBuilder(256); stringBuilder.AppendLine("*Song Search*"); stringBuilder.AppendLine("Type in Text and press Enter to search by Title, Artist"); stringBuilder.AppendLine("and Comment"); stringBuilder.AppendLine(""); stringBuilder.AppendLine("Examples:"); stringBuilder.AppendLine("/t title - Search by Title only"); stringBuilder.AppendLine("/a artist - Search by Artist only"); stringBuilder.AppendLine("/c Comment - Search by Comment only"); stringBuilder.AppendLine("/s search text - Case-sensitive Search"); stringBuilder.AppendLine("/t /a /s Text - Case-sensitive Search of Title and Artist"); stringBuilder.AppendLine("/all - Returns all songs in a single list"); stringBuilder.AppendLine("Type /q followed by Enter to exit search mode"); using (Bitmap bitmap2 = prvf説明.DrawPrivateFont(stringBuilder.ToString(), CPrivateFont.DrawMode.Edge, Color.PeachPuff, Color.Black, Color.DarkRed, Color.DarkRed, true)) { graphics.DrawImage(bitmap2, 20, 20, bitmap2.Width, bitmap2.Height); } } tx説明 = CDTXMania.tGenerateTexture(bitmap, b黒を透過する: false); } using (Bitmap bitmap3 = new Bitmap(6, rectパネル基本位置.Height - 4)) { using (Graphics graphics2 = Graphics.FromImage(bitmap3)) { graphics2.FillRectangle(Brushes.White, 0, 0, bitmap3.Width, bitmap3.Height); } txカーソル = CDTXMania.tGenerateTexture(bitmap3, b黒を透過する: false); txカーソル.nTransparency = 192; } t文字テクスチャを生成(); base.OnManagedCreateResources(); }
public void Initialize(List <CItemBase> menulist, bool showAllItems, string title, int defaultPos) { prvFont = new CPrivateFastFont(CSkin.Path(@"Graphics\fonts\ipag.ttf"), 18); stqMenuTitle = new stQuickMenuItem(); stqMenuTitle.cItem = new CItemBase(); stqMenuTitle.cItem.str項目名 = title; stqMenuTitle.txName = CDTXMania.tテクスチャの生成(prvFont.DrawPrivateFont(title, Color.White, Color.Black), false); stqMenuTitle.rectName = prvFont.RectStrings; lciMenuItems = new stQuickMenuItem[menulist.Count]; for (int i = 0; i < menulist.Count; i++) { stQuickMenuItem stqm = new stQuickMenuItem(); stqm.cItem = menulist[i]; stqm.txName = CDTXMania.tテクスチャの生成(prvFont.DrawPrivateFont(menulist[i].str項目名, Color.White, Color.Black), false); stqm.rectName = prvFont.RectStrings; lciMenuItems[i] = stqm; } bShowAllItems = showAllItems; n現在の選択行 = defaultPos; }
public override void OnManagedCreateResources() { if (!base.bNotActivated) { this.ftSongDifficultyFont = new System.Drawing.Font("Impact", 15f, FontStyle.Regular); this.iDrumSpeed = Image.FromFile(CSkin.Path(@"Graphics\7_panel_icons.jpg")); this.txジャケットパネル = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\7_JacketPanel.png")); this.txリザルト画像がないときの画像 = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\5_preimage default.png")); if (CDTXMania.ConfigIni.bストイックモード) { this.txリザルト画像 = this.txリザルト画像がないときの画像; } else if (((!this.tリザルト画像の指定があれば構築する()) && (!this.tプレビュー画像の指定があれば構築する()))) { this.txリザルト画像 = this.txリザルト画像がないときの画像; } #region [ Generation of song title, artist name and disclaimer textures ] if (string.IsNullOrEmpty(CDTXMania.DTX.TITLE) || (!CDTXMania.bCompactMode && CDTXMania.ConfigIni.b曲名表示をdefのものにする)) { this.strSongName = CDTXMania.stageSongSelection.r現在選択中の曲.strタイトル; } else { this.strSongName = CDTXMania.DTX.TITLE; } CPrivateFastFont pfTitle = new CPrivateFastFont(new FontFamily(CDTXMania.ConfigIni.str選曲リストフォント), 20, FontStyle.Regular); Bitmap bmpSongName = pfTitle.DrawPrivateFont(this.strSongName, CPrivateFont.DrawMode.Edge, Color.Black, Color.Black, this.clGITADORAgradationTopColor, this.clGITADORAgradationBottomColor, true); this.txSongName = CDTXMania.tGenerateTexture(bmpSongName, false); bmpSongName.Dispose(); pfTitle.Dispose(); CPrivateFastFont pfArtist = new CPrivateFastFont(new FontFamily(CDTXMania.ConfigIni.str選曲リストフォント), 15, FontStyle.Regular); Bitmap bmpArtistName = pfArtist.DrawPrivateFont(CDTXMania.DTX.ARTIST, CPrivateFont.DrawMode.Edge, Color.Black, Color.Black, this.clGITADORAgradationTopColor, this.clGITADORAgradationBottomColor, true); this.txArtistName = CDTXMania.tGenerateTexture(bmpArtistName, false); bmpArtistName.Dispose(); pfArtist.Dispose(); if (CDTXMania.ConfigIni.nPlaySpeed != 20) { double d = (double)(CDTXMania.ConfigIni.nPlaySpeed / 20.0); String strModifiedPlaySpeed = "Play Speed: x" + d.ToString("0.000"); CPrivateFastFont pfModifiedPlaySpeed = new CPrivateFastFont(new FontFamily(CDTXMania.ConfigIni.str選曲リストフォント), 18, FontStyle.Regular); Bitmap bmpModifiedPlaySpeed = pfModifiedPlaySpeed.DrawPrivateFont(strModifiedPlaySpeed, CPrivateFont.DrawMode.Edge, Color.White, Color.White, Color.Black, Color.Red, true); this.txModifiedPlaySpeed = CDTXMania.tGenerateTexture(bmpModifiedPlaySpeed, false); bmpModifiedPlaySpeed.Dispose(); pfModifiedPlaySpeed.Dispose(); } if (CDTXMania.stageResult.bIsTrainingMode) { String strResultsNotSavedTraining = "Training feature used"; CPrivateFastFont pfResultsNotSavedTraining = new CPrivateFastFont(new FontFamily(CDTXMania.ConfigIni.str選曲リストフォント), 18, FontStyle.Regular); Bitmap bmpResultsNotSavedTraining = pfResultsNotSavedTraining.DrawPrivateFont(strResultsNotSavedTraining, CPrivateFont.DrawMode.Edge, Color.White, Color.White, Color.Black, Color.Red, true); this.txTrainingMode = CDTXMania.tGenerateTexture(bmpResultsNotSavedTraining, false); bmpResultsNotSavedTraining.Dispose(); pfResultsNotSavedTraining.Dispose(); } String strResultsNotSaved = "Score will not be saved"; CPrivateFastFont pfResultsNotSaved = new CPrivateFastFont(new FontFamily(CDTXMania.ConfigIni.str選曲リストフォント), 18, FontStyle.Regular); Bitmap bmpResultsNotSaved = pfResultsNotSaved.DrawPrivateFont(strResultsNotSaved, CPrivateFont.DrawMode.Edge, Color.White, Color.White, Color.Black, Color.Red, true); this.txResultsNotSaved = CDTXMania.tGenerateTexture(bmpResultsNotSaved, false); bmpResultsNotSaved.Dispose(); pfResultsNotSaved.Dispose(); #endregion Bitmap bitmap2 = new Bitmap(0x3a, 0x12); Graphics graphics = Graphics.FromImage(bitmap2); graphics.Dispose(); this.txSongDifficulty = new CTexture(CDTXMania.app.Device, bitmap2, CDTXMania.TextureFormat, false); bitmap2.Dispose(); Bitmap bitmap3 = new Bitmap(100, 100); graphics = Graphics.FromImage(bitmap3); float num; //If Skill Mode is CLASSIC, always display lvl as Classic Style if (CDTXMania.ConfigIni.nSkillMode == 0 || (CDTXMania.ConfigIni.bCLASSIC譜面判別を有効にする && (CDTXMania.DTX.bチップがある.LeftCymbal == false) && (CDTXMania.DTX.bチップがある.LP == false) && (CDTXMania.DTX.bチップがある.LBD == false) && (CDTXMania.DTX.bチップがある.FT == false) && (CDTXMania.DTX.bチップがある.Ride == false))) { num = ((float)CDTXMania.stageSongSelection.rChosenScore.SongInformation.Level.Drums); } else { if (CDTXMania.stageSongSelection.rChosenScore.SongInformation.Level.Drums > 100) { num = ((float)CDTXMania.stageSongSelection.rChosenScore.SongInformation.Level.Drums); } else { num = ((float)CDTXMania.stageSongSelection.rChosenScore.SongInformation.Level.Drums) / 10f; } } //If Skill Mode is CLASSIC, always display lvl as Classic Style if (CDTXMania.ConfigIni.nSkillMode == 0 || (CDTXMania.ConfigIni.bCLASSIC譜面判別を有効にする && (CDTXMania.DTX.bチップがある.LeftCymbal == false) && (CDTXMania.DTX.bチップがある.LP == false) && (CDTXMania.DTX.bチップがある.LBD == false) && (CDTXMania.DTX.bチップがある.FT == false) && (CDTXMania.DTX.bチップがある.Ride == false) && (CDTXMania.DTX.b強制的にXG譜面にする == false))) { graphics.DrawString(string.Format("{0:00}", num), this.ftSongDifficultyFont, new SolidBrush(Color.FromArgb(0xba, 0xba, 0xba)), (float)0f, (float)-4f); } else { graphics.DrawString(string.Format("{0:0.00}", num), this.ftSongDifficultyFont, new SolidBrush(Color.FromArgb(0xba, 0xba, 0xba)), (float)0f, (float)-4f); } this.txSongLevel = new CTexture(CDTXMania.app.Device, bitmap3, CDTXMania.TextureFormat, false); graphics.Dispose(); bitmap3.Dispose(); Bitmap bitmap4 = new Bitmap(0x2a, 0x30); graphics = Graphics.FromImage(bitmap4); graphics.DrawImage(this.iDrumSpeed, new Rectangle(0, 0, 0x2a, 0x30), new Rectangle(0, CDTXMania.ConfigIni.nScrollSpeed.Drums * 0x30, 0x2a, 0x30), GraphicsUnit.Pixel); this.txDrumSpeed = new CTexture(CDTXMania.app.Device, bitmap4, CDTXMania.TextureFormat, false); graphics.Dispose(); //graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; bitmap4.Dispose(); base.OnManagedCreateResources(); } }