private void InitDesktop() { if (desktop != null && sprites != null) { return; } this.desktop = new Desktop(this, GetWidth(), GetHeight()); this.sprites = new Sprites(GetWidth(), GetHeight()); if (dialog == null) { LPixmap g = new LPixmap(GetWidth() - 20, GetHeight() / 2 - 20, true); g.SetAlphaValue(0, 0, 0, 125); g.FillRect(0, 0, g.GetWidth(), g.GetHeight()); g.Dispose(); dialog = g.Texture; g = null; } this.message = new LMessage(dialog, 0, 0); this.message.SetFontColor(LColor.white); int size = message.GetWidth() / (message.GetMessageFont().GetSize()); if (LSystem.scaleWidth != 1 || LSystem.scaleHeight != 1) { if (size % 2 != 0) { size = size + 2; } else { size = size + 3; } } else { if (size % 2 != 0) { size = size - 3; } else { size = size - 4; } } this.message.SetMessageLength(size); this.message.SetLocation((GetWidth() - message.GetWidth()) / 2, GetHeight() - message.GetHeight() - 10); this.message.SetVisible(false); this.select = new LSelect(dialog, 0, 0); this.select.SetLocation(message.X(), message.Y()); this.scrCG = new AVGCG(); this.desktop.Add(message); this.desktop.Add(select); this.select.SetVisible(false); }
public override void Dispose() { running = false; try { if (avgThread != null) { avgThread.Interrupt(); avgThread = null; } } catch (Exception) { } if (desktop != null) { desktop.Dispose(); desktop = null; } if (sprites != null) { sprites.Dispose(); sprites = null; } if (command != null) { command = null; } if (scrCG != null) { scrCG.Dispose(); scrCG = null; } if (dialog != null) { if (dialog.GetFileName() != null) { dialog.Destroy(); dialog = null; } } base.Dispose(); }
public void SetScrCG(AVGCG scrCG) { this.scrCG = scrCG; }
private void InitDesktop() { if (desktop != null && sprites != null) { return; } this.desktop = new Desktop(this, GetWidth(), GetHeight()); this.sprites = new Sprites(GetWidth(), GetHeight()); if (dialog == null) { LImage tmp = LImage.CreateImage(GetWidth() - 20, GetHeight() / 2 - 20, true); LGraphics g = tmp.GetLGraphics(); g.SetColor(0, 0, 0, 125); g.FillRect(0, 0, tmp.GetWidth(), tmp.GetHeight()); g.Dispose(); g = null; dialog = new LTexture(GLLoader.GetTextureData(tmp)); if (tmp != null) { tmp.Dispose(); tmp = null; } } this.message = new LMessage(dialog, 0, 0); this.message.SetFontColor(LColor.white); int size = message.GetWidth() / (message.GetMessageFont().GetSize()); if (LSystem.scaleWidth != 1 || LSystem.scaleHeight != 1) { if (size % 2 != 0) { size = size + 2; } else { size = size + 3; } } else { if (size % 2 != 0) { size = size - 3; } else { size = size - 4; } } this.message.SetMessageLength(size); this.message.SetLocation((GetWidth() - message.GetWidth()) / 2, GetHeight() - message.GetHeight() - 10); this.message.SetVisible(false); this.select = new LSelect(dialog, 0, 0); this.select.SetLocation(message.X(), message.Y()); this.scrCG = new AVGCG(); this.desktop.Add(message); this.desktop.Add(select); this.select.SetVisible(false); }