public override void OnInit(Game currentGame, Form owner, Save settings) { base.currentGame = currentGame; base.owner = owner; base.info = settings; this.owner.Controls.Add(this); this.Dock = DockStyle.Fill; try { SlimDX.DirectWrite.Factory m = new SlimDX.DirectWrite.Factory(FactoryType.Shared); textFormatCentered = m.CreateTextFormat(this.Font.FontFamily.Name, SlimDX.DirectWrite.FontWeight.Regular, SlimDX.DirectWrite.FontStyle.Normal, SlimDX.DirectWrite.FontStretch.Expanded, 50, "de-de"); textFormatCentered.TextAlignment = SlimDX.DirectWrite.TextAlignment.Center; textFormatCentered.ParagraphAlignment = SlimDX.DirectWrite.ParagraphAlignment.Center; } catch (Exception) { } this.initializeGraphics(); this.FinishedInit = true; this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.ResizeRedraw, true); this.UpdateStyles(); try { if (string.IsNullOrEmpty(settings.Background)) { this.BackgroundImage = Image.FromFile(System.IO.Path.Combine(Application.StartupPath, "Images", "Image.jpg")); } else { this.BackgroundImage = Image.FromFile(settings.Background); } } catch (Exception) { } this.e = new Graphics.DirectGraphics(this.renderTarget); this.Invalidate(); }
public override void OnInit(Game currentGame, Form owner, Save settings) { base.currentGame = currentGame; base.owner = owner; base.info = settings; this.owner.Controls.Add(this); this.Dock = DockStyle.Fill; try { SlimDX.DirectWrite.Factory m = new SlimDX.DirectWrite.Factory(FactoryType.Shared); textFormatCentered = m.CreateTextFormat(this.Font.FontFamily.Name, SlimDX.DirectWrite.FontWeight.Regular, SlimDX.DirectWrite.FontStyle.Normal, SlimDX.DirectWrite.FontStretch.Expanded, 50, "de-de"); textFormatCentered.TextAlignment = SlimDX.DirectWrite.TextAlignment.Center; textFormatCentered.ParagraphAlignment = SlimDX.DirectWrite.ParagraphAlignment.Center; } catch (Exception) { } this.initializeGraphics(); this.FinishedInit = true; this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.ResizeRedraw, true); this.UpdateStyles(); try { if (string.IsNullOrEmpty(settings.Background)) this.BackgroundImage = Image.FromFile(System.IO.Path.Combine(Application.StartupPath, "Images", "Image.jpg")); else this.BackgroundImage = Image.FromFile(settings.Background); } catch (Exception) { } this.e = new Graphics.DirectGraphics(this.renderTarget); this.Invalidate(); }