public override void OnManagedリソースの作成() { if (!b活性化してない) { string[] strMenuItem = { "System", "Drums", "Exit" }; txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; using (var prvFont = new CPrivateFastFont(CSkin.Path(@"mplus-1p-heavy.ttf"), 20)) { for (var i = 0; i < strMenuItem.Length; i++) { using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black)) { txMenuItemLeft[i, 0] = TJAPlayer3.tテクスチャの生成(bmpStr, false); } using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black, Color.Yellow, Color.OrangeRed)) { txMenuItemLeft[i, 1] = TJAPlayer3.tテクスチャの生成(bmpStr, false); } } } if (bメニューにフォーカス中) { t説明文パネルに現在選択されているメニューの説明を描画する(); } else { t説明文パネルに現在選択されている項目の説明を描画する(); } base.OnManagedリソースの作成(); } }
private void tプレビュー画像_動画の変更() { if (this.avi != null) { this.avi.Dispose(); this.avi = null; } this.pAVIBmp = IntPtr.Zero; this.nAVI再生開始時刻 = -1; if (!CDTXMania.ConfigIni.bストイックモード) { if (this.tプレビュー動画の指定があれば構築する()) { return; } if (this.tプレビュー画像の指定があれば構築する()) { return; } if (this.t背景画像があればその一部からプレビュー画像を構築する()) { return; } } this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像; this.str現在のファイル名 = ""; }
private bool tプレビュー画像の指定があれば構築する() { Cスコア cスコア = CDTXMania.stage選曲.r現在選択中のスコア; if ((cスコア == null) || string.IsNullOrEmpty(cスコア.譜面情報.Preimage)) { return(false); } string str = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Preimage; if (!str.Equals(this.str現在のファイル名)) { CDTXMania.tテクスチャの解放(ref this.txプレビュー画像); this.str現在のファイル名 = str; if (!File.Exists(this.str現在のファイル名)) { Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { this.str現在のファイル名 }); return(false); } this.txプレビュー画像 = CDTXMania.tテクスチャの生成(this.str現在のファイル名, false); if (this.txプレビュー画像 != null) { this.r表示するプレビュー画像 = this.txプレビュー画像; } else { this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像; } } return(true); }
private bool tリザルト画像の指定があれば構築する() { int rank = CScoreIni.tCalculateOverallRankValue(CDTXMania.stageResult.stPerformanceEntry.Drums, CDTXMania.stageResult.stPerformanceEntry.Guitar, CDTXMania.stageResult.stPerformanceEntry.Bass); if (rank == 99) // #23534 2010.10.28 yyagi: 演奏チップが0個のときは、rankEと見なす { rank = 6; } if (string.IsNullOrEmpty(CDTXMania.DTX.RESULTIMAGE[rank])) { return(false); } CDTXMania.tReleaseTexture(ref this.txリザルト画像); this.r表示するリザルト画像 = null; string path = CDTXMania.DTX.strFolderName + CDTXMania.DTX.RESULTIMAGE[rank]; if (!File.Exists(path)) { Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { path }); return(false); } this.txリザルト画像 = CDTXMania.tGenerateTexture(path); this.r表示するリザルト画像 = this.txリザルト画像; return(this.r表示するリザルト画像 != null); }
private bool tプレビュー画像の指定があれば構築する() { CScore cスコア = CDTXMania.stageSongSelection.rSelectedScore; if ((cスコア == null) || string.IsNullOrEmpty(cスコア.SongInformation.Preimage)) { return(false); } string str = cスコア.FileInformation.AbsoluteFolderPath + cスコア.SongInformation.Preimage; if (!str.Equals(this.str現在のファイル名)) { CDTXMania.tReleaseTexture(ref this.txプレビュー画像); this.str現在のファイル名 = str; if (!File.Exists(this.str現在のファイル名)) { Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { this.str現在のファイル名 }); return(false); } this.txプレビュー画像 = CDTXMania.tGenerateTexture(this.str現在のファイル名, false); if (this.txプレビュー画像 != null) { this.r表示するプレビュー画像 = this.txプレビュー画像; } else { this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像; } } return(true); }
// CActivity 実装(共通クラスからの差分のみ) public override int OnUpdateAndDraw() { if (!base.bNotActivated) { for (int i = 0; i < 6; i++) { if (!base.ctUpdate[i].b停止中) { EInstrumentPart e楽器パート = (i < 3) ? EInstrumentPart.GUITAR : EInstrumentPart.BASS; CTexture texture = CDTXMania.ConfigIni.bReverse[(int)e楽器パート] ? base.txFlush[(i % 3) + 3] : base.txFlush[i % 3]; int num2 = CDTXMania.ConfigIni.bLeft[(int)e楽器パート] ? 1 : 0; for (int j = 0; j < 3; j++) { int x = (((i < 3) ? 0x1fb : 0x18e) + this.nRGBのX座標[num2, i]) + ((0x10 * base.ctUpdate[i].nCurrentValue) / 100); int y = ((i < 3) ? 0x39 : 0x39) + (j * 0x76); if (texture != null) { texture.tDraw2D(CDTXMania.app.Device, x, y, new Rectangle(j * 0x20, 0, (0x18 * (100 - base.ctUpdate[i].nCurrentValue)) / 100, 0x76)); } } base.ctUpdate[i].tUpdate(); if (base.ctUpdate[i].bReachedEndValue) { base.ctUpdate[i].tStop(); } } } } return(0); }
public override void OnManagedリソースの作成() // OPTIONと画像以外共通 { if (!base.b活性化してない) { string[] strMenuItem = { "System", "Drums", "Exit" }; txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; using (var prvFont = new CPrivateFastFont(TJAPlayer3.ConfigIni.FontName, 20)) { for (int i = 0; i < strMenuItem.Length; i++) { using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black, TJAPlayer3.Skin.Font_Edge_Ratio)) { txMenuItemLeft[i, 0] = TJAPlayer3.tCreateTexture(bmpStr); } using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black, Color.Yellow, Color.OrangeRed, TJAPlayer3.Skin.Font_Edge_Ratio)) { txMenuItemLeft[i, 1] = TJAPlayer3.tCreateTexture(bmpStr); } } } if (this.bメニューにフォーカス中) { this.t説明文パネルに現在選択されているメニューの説明を描画する(); } else { this.t説明文パネルに現在選択されている項目の説明を描画する(); } base.OnManagedリソースの作成(); } }
private void tDrawSelectedItemDescriptionInDescriptionPanel() { try { var image = new Bitmap(440, 0x100); // 説明文領域サイズの縦横 2 倍。(描画時に 0.5 倍で表示する。) var graphics = Graphics.FromImage(image); graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; CItemBase item = this.actList.ibCurrentSelection; if ((item.str説明文 != null) && (item.str説明文.Length > 0)) { int num = 0; foreach (string str in item.str説明文.Split(new char[] { '\n' })) { graphics.DrawString(str, this.ftFont, Brushes.White, new PointF(4f, (float)num)); num += 30; } } graphics.Dispose(); if (this.txDescriptionPanel != null) { this.txDescriptionPanel.Dispose(); } this.txDescriptionPanel = new CTexture(CDTXMania.app.Device, image, CDTXMania.TextureFormat); this.txDescriptionPanel.vcScaleRatio.X = 0.8f; this.txDescriptionPanel.vcScaleRatio.Y = 0.8f; image.Dispose(); } catch (CTextureCreateFailedException) { Trace.TraceError("説明文パネルテクスチャの作成に失敗しました。"); this.txDescriptionPanel = null; } }
private void tDrawSelectedItemDescriptionInDescriptionPanel() { try { var image = new Bitmap((int)(400), (int)(192)); // 説明文領域サイズの縦横 2 倍。(描画時に 0.5 倍で表示する___のは中止。処理速度向上のため。) var graphics = Graphics.FromImage(image); graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; CItemBase item = this.actList.ibCurrentSelection; if ((item.str説明文 != null) && (item.str説明文.Length > 0)) { //int num = 0; //foreach( string str in item.str説明文.Split( new char[] { '\n' } ) ) //{ // graphics.DrawString( str, this.ftFont, Brushes.White, new PointF( 4f * Scale.X, (float) num * Scale.Y ) ); // num += 30; //} graphics.DrawString(item.str説明文, this.ftFont, Brushes.Black, new RectangleF(4f, (float)0, 230, 430)); } graphics.Dispose(); if (this.txDescriptionPanel != null) { this.txDescriptionPanel.Dispose(); } this.txDescriptionPanel = new CTexture(CDTXMania.app.Device, image, CDTXMania.TextureFormat, false); //this.txDescriptionPanel.vcScaleRatio.X = 0.58f; //this.txDescriptionPanel.vcScaleRatio.Y = 0.58f; image.Dispose(); } catch (CTextureCreateFailedException) { Trace.TraceError("説明文パネルテクスチャの作成に失敗しました。"); this.txDescriptionPanel = null; } }
public override void OnManagedCreateResources() { if (!base.bNotActivated) { if (CDTXMania.ConfigIni.nJudgeAnimeType == 1) { //this.tx判定文字列[0] = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\7_judge strings.png")); //this.tx判定文字列[1] = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\7_judge strings.png")); //this.tx判定文字列[2] = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\7_judge strings.png")); //2013.8.2 kairera0467 CStage演奏画面共通側で読み込むテスト。 } else if (CDTXMania.ConfigIni.nJudgeAnimeType == 2) { } else { this.tx判定文字列[0] = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\ScreenPlay judge strings 1.png")); this.tx判定文字列[1] = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\ScreenPlay judge strings 2.png")); this.tx判定文字列[2] = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\ScreenPlay judge strings 3.png")); } this.txlag数値 = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\7_lag numbers.png")); base.OnManagedCreateResources(); } }
private void t説明文パネルに現在選択されている項目の説明を描画する() { try { var image = new Bitmap(440, 288); // 説明文領域サイズの縦横 2 倍。(描画時に 0.5 倍で表示する___のは中止。処理速度向上のため。) var graphics = Graphics.FromImage(image); graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; CItemBase item = this.actList.ib現在の選択項目; if ((item.str説明文 != null) && (item.str説明文.Length > 0)) { graphics.DrawString(item.str説明文, this.ftフォント, Brushes.White, new RectangleF(8f, 0, 630, 430)); } graphics.Dispose(); if (this.tx説明文パネル != null) { this.tx説明文パネル.Dispose(); } this.tx説明文パネル = new CTexture(TJAPlayer3.app.Device, image, TJAPlayer3.TextureFormat); image.Dispose(); } catch (CTextureCreateFailedException e) { Trace.TraceError(e.ToString()); Trace.TraceError("説明文パネルテクスチャの作成に失敗しました。"); this.tx説明文パネル = null; } }
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リソースの作成(); } }
/// <param name="x">下中央基準のX</param> /// <param name="y">下中央基準のY</param> private void tDrawBox(float x, float y, int nPlayer) { if (TJAPlayer3.Tx.PlayOption_List != null && TJAPlayer3.Tx.PlayOption_Active != null) { TJAPlayer3.Tx.PlayOption_List.t2D拡大率考慮描画(TJAPlayer3.app.Device, CTexture.RefPnt.Down, x, y, new Rectangle(0, TJAPlayer3.Skin.PlayOption_Box_Section_Y[2], TJAPlayer3.Tx.PlayOption_List.szTextureSize.Width, TJAPlayer3.Tx.PlayOption_List.szTextureSize.Height - TJAPlayer3.Skin.PlayOption_Box_Section_Y[2])); //下部 y -= TJAPlayer3.Tx.PlayOption_List.szTextureSize.Height - TJAPlayer3.Skin.PlayOption_Box_Section_Y[2]; } else { y -= 100; } for (int i = 0; i < lci[nPlayer].Count; i++) { if (TJAPlayer3.Tx.PlayOption_List != null && TJAPlayer3.Tx.PlayOption_Active != null) { TJAPlayer3.Tx.PlayOption_List.t2D拡大率考慮描画(TJAPlayer3.app.Device, CTexture.RefPnt.Down, x, y, new Rectangle(0, TJAPlayer3.Skin.PlayOption_Box_Section_Y[1], TJAPlayer3.Tx.PlayOption_List.szTextureSize.Width, TJAPlayer3.Skin.PlayOption_Box_Section_Y[2] - TJAPlayer3.Skin.PlayOption_Box_Section_Y[1])); //リスト本体 if (lci[nPlayer].Count - i == NowRow[nPlayer] + 1) { TJAPlayer3.Tx.PlayOption_Active.t2D拡大率考慮描画(TJAPlayer3.app.Device, CTexture.RefPnt.Down, x, y); } } this.NameTexture[nPlayer][lci[nPlayer].Count - i - 1].ItemNameTexture.t2D描画(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.PlayOption_Name_XY_Diff[0], y - (TJAPlayer3.Skin.PlayOption_Box_Section_Y[2] - TJAPlayer3.Skin.PlayOption_Box_Section_Y[1]) + TJAPlayer3.Skin.PlayOption_Name_XY_Diff[1]); if (lci[nPlayer][lci[nPlayer].Count - i - 1].strName.Equals("ばいそく")) { using (CTexture texture = TJAPlayer3.tCreateTexture(this.Font.DrawPrivateFont(((lci[nPlayer][lci[nPlayer].Count - i - 1].GetIndex() + 1) * 0.1).ToString("0.0"), Color.White, Color.Black, TJAPlayer3.Skin.Font_Edge_Ratio))) { texture.t2D描画(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.PlayOption_List_XY_Diff[0] - texture.szTextureSize.Width / 2, y - (TJAPlayer3.Skin.PlayOption_Box_Section_Y[2] - TJAPlayer3.Skin.PlayOption_Box_Section_Y[1]) + TJAPlayer3.Skin.PlayOption_List_XY_Diff[1]); } } else if (lci[nPlayer][lci[nPlayer].Count - i - 1].strName.Equals("演奏速度")) { using (CTexture texture = TJAPlayer3.tCreateTexture(this.Font.DrawPrivateFont((lci[nPlayer][lci[nPlayer].Count - i - 1].GetIndex() * 0.05).ToString("0.00"), Color.White, Color.Black, TJAPlayer3.Skin.Font_Edge_Ratio))) { texture.t2D描画(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.PlayOption_List_XY_Diff[0] - texture.szTextureSize.Width / 2, y - (TJAPlayer3.Skin.PlayOption_Box_Section_Y[2] - TJAPlayer3.Skin.PlayOption_Box_Section_Y[1]) + TJAPlayer3.Skin.PlayOption_List_XY_Diff[1]); } } else if (lci[nPlayer][lci[nPlayer].Count - i - 1].eItemType == CItemBase.EItemType.Integer) { using (CTexture texture = TJAPlayer3.tCreateTexture(this.Font.DrawPrivateFont((lci[nPlayer][lci[nPlayer].Count - i - 1].GetIndex()).ToString(), Color.White, Color.Black, TJAPlayer3.Skin.Font_Edge_Ratio))) { texture.t2D描画(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.PlayOption_List_XY_Diff[0] - texture.szTextureSize.Width / 2, y - (TJAPlayer3.Skin.PlayOption_Box_Section_Y[2] - TJAPlayer3.Skin.PlayOption_Box_Section_Y[1]) + TJAPlayer3.Skin.PlayOption_List_XY_Diff[1]); } } else if (lci[nPlayer][lci[nPlayer].Count - i - 1].eItemType == CItemBase.EItemType.List) { this.NameTexture[nPlayer][lci[nPlayer].Count - i - 1].ItemListTexture[lci[nPlayer][lci[nPlayer].Count - i - 1].GetIndex()].t2D描画(TJAPlayer3.app.Device, x + 90 - this.NameTexture[nPlayer][lci[nPlayer].Count - i - 1].ItemListTexture[lci[nPlayer][lci[nPlayer].Count - i - 1].GetIndex()].szTextureSize.Width / 2, y - (TJAPlayer3.Skin.PlayOption_Box_Section_Y[2] - TJAPlayer3.Skin.PlayOption_Box_Section_Y[1]) + TJAPlayer3.Skin.PlayOption_List_XY_Diff[1]); } y -= TJAPlayer3.Skin.PlayOption_Box_Section_Y[2] - TJAPlayer3.Skin.PlayOption_Box_Section_Y[1]; } if (TJAPlayer3.Tx.PlayOption_List != null && TJAPlayer3.Tx.PlayOption_Active != null) { TJAPlayer3.Tx.PlayOption_List.t2D拡大率考慮描画(TJAPlayer3.app.Device, CTexture.RefPnt.Down, x, y, new Rectangle(0, TJAPlayer3.Skin.PlayOption_Box_Section_Y[0], TJAPlayer3.Tx.PlayOption_List.szTextureSize.Width, TJAPlayer3.Skin.PlayOption_Box_Section_Y[1] - TJAPlayer3.Skin.PlayOption_Box_Section_Y[0])); //上部 } }
public override void OnManagedリソースの作成() { if (!base.b活性化してない) { this.txScore = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_Score_number.png")); base.OnManagedリソースの作成(); } }
public override void OnManagedCreateResources() { if (!base.bNotActivated && !CDTXMania.DTXVmode.Enabled && !CDTXMania.DTX2WAVmode.Enabled) { this.txScore = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\7_score numbersGD.png")); base.OnManagedCreateResources(); } }
public override void OnManagedリソースの作成() { if (!base.b活性化してない) { this.tx判定文字列 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_judgement.png")); base.OnManagedリソースの作成(); } }
public static void txGenerateProgressBarHelper(ref CTexture txRefProgressBarTexture, string strProgressBar, int nWidth, int nHeight, int nIntervals) { if (strProgressBar == null) { return; } // Color[] clBarColors = new Color[4] { Color.Black, Color.DeepSkyBlue, Color.Yellow, Color.Yellow }; char[] arrProgress = strProgressBar.ToCharArray(); if (arrProgress.Length == nIntervals) { using (Bitmap tempBarBitmap = new Bitmap(nWidth, nHeight)) { using (Graphics barGraphics = Graphics.FromImage(tempBarBitmap)) { int nOffsetY = nHeight; for (int i = 0; i < nIntervals; i++) { int nCurrentPosY = (int)Math.Round((double)nHeight - ((double)i + 1.0) * (double)nHeight / (double)nIntervals); int nCurrentSectionHeight = nOffsetY - nCurrentPosY; nOffsetY = nCurrentPosY; int nColorIndex = (int)(arrProgress[i] - '0'); //Handle out of range if (nColorIndex < 0 || nColorIndex > 3) { nColorIndex = 0; } //Draw current section barGraphics.FillRectangle(new SolidBrush(clBarColors[nColorIndex]), 0, nCurrentPosY, tempBarBitmap.Width, nCurrentSectionHeight); } } txRefProgressBarTexture = CDTXMania.tGenerateTexture(tempBarBitmap); } } else { using (Bitmap tempBarBitmap = new Bitmap(nWidth, nHeight)) { using (Graphics barGraphics = Graphics.FromImage(tempBarBitmap)) { barGraphics.FillRectangle(new SolidBrush(clBarColors[0]), 0, 0, tempBarBitmap.Width, tempBarBitmap.Height); } txRefProgressBarTexture = CDTXMania.tGenerateTexture(tempBarBitmap); } //CDTXMania.t安全にDisposeする(ref txProgressBarTexture); } }
public override void OnManagedCreateResources() { if (!base.bNotActivated) { this.txRGB = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\7_RGB buttons.png")); this.txShutter = CDTXMania.tGenerateTexture(CSkin.Path(@"Graphics\7_shutter_GB.png")); base.OnManagedCreateResources(); } }
public override void OnManagedリソースの作成() { this.tx残り時間数字 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_combo taiko.png")); this.tx加算時間数字 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_Score_number_Add.png")); this.txタイマー枠 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_TimerPanel.png")); this.txタイマー針 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_TimerTick.png")); this.tx背景黒 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\Tile black 64x64.png")); base.OnManagedリソースの作成(); }
private CTexture GenerateTexture(TitleTextureKey title) { using (var bmp = new Bitmap(title.cPrivateFastFont.DrawPrivateFont( title.str文字, title.forecolor, title.backcolor))) { CTexture tx文字テクスチャ = TJAPlayer3.tテクスチャの生成(bmp, false); return(tx文字テクスチャ); } }
private void NullCheckAndRender(ref CTexture tx) { if (tx == null) { return; } tx.n透明度 = 0; tx.t2D描画(TJAPlayer3.app.Device, 0, 0); tx.n透明度 = 255; }
private static void NullCheckAndRender(ref CTexture tx) { if (tx == null) { return; } tx.Opacity = 0; tx.t2D描画(TJAPlayer3.app.Device, 0, 0); tx.Opacity = 255; }
private void t説明文パネルに現在選択されているメニューの説明を描画する() { try { using (Bitmap image = new Bitmap(440, 288)) // 説明文領域サイズの縦横 2 倍。(描画時に 0.5 倍で表示する。) { using (var graphics = Graphics.FromImage(image)) { graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; string[,] str = new string[2, 2]; switch (this.n現在のメニュー番号) { case 0: str[0, 0] = "システムに関係する項目を設定します。"; str[0, 1] = ""; str[1, 0] = "Settings for an overall systems."; break; case 1: str[0, 0] = "ドラムの演奏に関する項目を設定します。"; str[0, 1] = ""; str[1, 0] = "Settings to play the drums."; str[1, 1] = ""; break; case 2: str[0, 0] = "設定を保存し、コンフィグ画面を終了します。"; str[0, 1] = ""; str[1, 0] = "Save the settings and exit from"; str[1, 1] = "CONFIGURATION menu."; break; } int c = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; for (int i = 0; i < 2; i++) { graphics.DrawString(str[c, i], this.ftフォント, Brushes.White, new PointF(8f, (i * 30) * 1.5f)); } if (this.tx説明文パネル != null) { this.tx説明文パネル.Dispose(); } this.tx説明文パネル = TJAPlayer3.tテクスチャの生成(image, true); } } } catch (CTextureCreateFailedException e) { Trace.TraceError(e.ToString()); Trace.TraceError("説明文テクスチャの作成に失敗しました。"); this.tx説明文パネル = null; } }
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(); }
private static void NullCheckAndRender(CTexture texture) { if (texture == null) { return; } var originalOpacity = texture.Opacity; texture.Opacity = 0; texture.t2D描画(TJAPlayer3.app.Device, 0, 0); texture.Opacity = originalOpacity; }
private void t背景テクスチャを生成() { CDTXMania.t安全にDisposeする(ref tx背景); using (Bitmap bitmap = new Bitmap(rectパネル基本位置.Width, rectパネル基本位置.Height)) { using (Graphics graphics = Graphics.FromImage(bitmap)) { graphics.FillRectangle(Brushes.Black, 0, 0, bitmap.Width, bitmap.Height); } tx背景 = CDTXMania.tGenerateTexture(bitmap); tx背景.nTransparency = 192; } }
private CTexture GenerateTitleTexture(TitleTextureKey titleTextureKey) { using (var bmp = new Bitmap(titleTextureKey.cPrivateFastFont.DrawPrivateFont( titleTextureKey.str文字, titleTextureKey.forecolor, titleTextureKey.backcolor, true))) { CTexture tx文字テクスチャ = TJAPlayer3.tテクスチャの生成(bmp, false); if (tx文字テクスチャ.szテクスチャサイズ.Height > titleTextureKey.maxHeight) { tx文字テクスチャ.vc拡大縮小倍率.Y = (float)(((double)titleTextureKey.maxHeight) / tx文字テクスチャ.szテクスチャサイズ.Height); } return(tx文字テクスチャ); } }
private void txGenerateProgressBarLine(ref CTexture txProgressBarTexture, string strProgressBar) { int nBarWidth = 8; int nBarHeight = this.nHeight; //294; char[] arrProgress = strProgressBar.ToCharArray(); if (arrProgress.Length == nSectionIntervalCount) { using (Bitmap tempBarBitmap = new Bitmap(nBarWidth, nBarHeight)) { using (Graphics barGraphics = Graphics.FromImage(tempBarBitmap)) { int nOffsetY = nBarHeight; for (int i = 0; i < nSectionIntervalCount; i++) { int nCurrentPosY = (int)Math.Round((double)nBarHeight - ((double)i + 1.0) * (double)nBarHeight / (double)CActPerfProgressBar.nSectionIntervalCount); int nCurrentSectionHeight = nOffsetY - nCurrentPosY; nOffsetY = nCurrentPosY; int nColorIndex = (int)(arrProgress[i] - '0'); //Handle out of range if (nColorIndex < 0 || nColorIndex > 3) { nColorIndex = 0; } //Draw current section barGraphics.FillRectangle(new SolidBrush(this.clProgressBarColors[nColorIndex]), 2, nCurrentPosY, tempBarBitmap.Width - 4, nCurrentSectionHeight); } barGraphics.FillRectangle(new SolidBrush(Color.Gray), 0, 0, 2, tempBarBitmap.Height); barGraphics.FillRectangle(new SolidBrush(Color.Gray), 6, 0, 1, tempBarBitmap.Height); } txProgressBarTexture = CDTXMania.tGenerateTexture(tempBarBitmap); } } else { using (Bitmap tempBarBitmap = new Bitmap(nBarWidth, nBarHeight)) { using (Graphics barGraphics = Graphics.FromImage(tempBarBitmap)) { barGraphics.FillRectangle(new SolidBrush(this.clProgressBarColors[0]), 2, 0, tempBarBitmap.Width - 4, tempBarBitmap.Height); barGraphics.FillRectangle(new SolidBrush(Color.Gray), 0, 0, 2, tempBarBitmap.Height); barGraphics.FillRectangle(new SolidBrush(Color.Gray), 6, 0, 2, tempBarBitmap.Height); } txProgressBarTexture = CDTXMania.tGenerateTexture(tempBarBitmap); } //CDTXMania.t安全にDisposeする(ref txProgressBarTexture); } }
private void ShowProgressByFilename(string strファイル名) { if (graphicsFilename != null && ftFilename != null) { graphicsFilename.Clear(Color.Transparent); graphicsFilename.DrawString(strファイル名, ftFilename, Brushes.White, new RectangleF(0, 0, 640, 24)); if (txFilename != null) { txFilename.Dispose(); } txFilename = new CTexture(TJAPlayer3.app.Device, bitmapFilename, TJAPlayer3.TextureFormat); txFilename.vc拡大縮小倍率 = new Vector3(0.5f, 0.5f, 1f); txFilename.t2D描画(TJAPlayer3.app.Device, 0, 720 - 16); } }
public override void OnManagedリソースの作成() { if (this.b活性化してない) { return; } //this.txCOMBOドラム = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums combo drums.png" ) ); //this.txCOMBOギター = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums combo guitar.png" ) ); this.txCOMBO太鼓 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_combo taiko.png")); this.txCOMBO太鼓_でかいやつ = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_combo taiko_large.png")); this.txコンボラメ = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_Combo effect.png")); base.OnManagedリソースの作成(); }