/// <summary> /// 构造一个可用桌面 /// </summary> /// /// <param name="input"></param> /// <param name="width"></param> /// <param name="height"></param> public Desktop(LInput input, int width, int height) { this.clickComponent = new LComponent[1]; this.contentPane = new LPanel(0, 0, width, height); this.input = input; this.SetDesktop(this.contentPane); }
/// <summary> /// 空桌面布局 /// </summary> /// private Desktop() { this.clickComponent = new LComponent[1]; this.contentPane = new LPanel(0, 0, 1, 1); this.input = null; this.SetDesktop(this.contentPane); }
public virtual void Dispose() { this.isClose = true; this.desktop.SetComponentStat(this, false); if (this.parent != null) { this.parent.Remove(this); } this.desktop = Desktop.EMPTY_DESKTOP; this.input = null; this.parent = null; if (imageUI != null) { for (int i = 0; i < imageUI.Length; i++) { imageUI[i].Destroy(); imageUI[i] = null; } this.imageUI = null; } if (background != null) { this.background.Destroy(); this.background = null; } this.selected = false; this.visible = false; }
public virtual void SetScreen(SpriteBatchScreen s) { if (s == _screen) { return; } this._screen = s; this._input = s.GetInput(); }
internal void SetDesktop(Desktop desktop_0) { if (this.desktop == desktop_0) { return; } this.desktop = desktop_0; this.input = desktop_0.input; }
public abstract void HandleInput(LInput input);
private Desktop() { this.contentPane = new LPanel(0, 0, 1, 1); this.input = null; this.SetDesktop(this.contentPane); }
public virtual void OnCreate(int width, int height) { this.mode = SCREEN_CANVAS_REPAINT; this.baseInput = this; this.width = width; this.height = height; this.halfWidth = width / 2; this.halfHeight = height / 2; this.touchX = touchY = lastTouchX = lastTouchY = touchDX = touchDY = 0; this.isLoad = isLock = isClose = isTranslate = isGravity = false; if (sprites != null) { sprites.Dispose(); sprites = null; } this.sprites = new Sprites(width, height); if (desktop != null) { desktop.Dispose(); desktop = null; } this.desktop = new Desktop(baseInput, width, height); this.isNext = true; }
public Desktop(LInput input, int width, int height) { this.contentPane = new LPanel(0, 0, width, height); this.input = input; this.SetDesktop(this.contentPane); }