public void Update() { this.width = game.width; this.height = game.height; if (_startButton.HitTestPoint(Input.mouseX, Input.mouseY)) { _startButton.texture.Load("HUD/start selected.png"); } else { _startButton.texture.Load("HUD/start.png"); } if (_quitButton.HitTestPoint(Input.mouseX, Input.mouseY)) { _quitButton.texture.Load("HUD/quit selected.png"); } else { _quitButton.texture.Load("HUD/quit.png"); } if (_infoButton.HitTestPoint(Input.mouseX, Input.mouseY)) { _infoButton.texture.Load("HUD/info selected.png"); } else { _infoButton.texture.Load("HUD/info.png"); } if (Input.GetMouseButtonDown(0)) { if (_startButton.HitTestPoint(Input.mouseX, Input.mouseY)) { StartGame(); } if (_quitButton.HitTestPoint(Input.mouseX, Input.mouseY)) { game.Destroy(); } if (_infoButton.HitTestPoint(Input.mouseX, Input.mouseY)) { InfoScreen info = new InfoScreen(_mygame); game.AddChild(info); _backgroundChanel.Stop(); _backgroundMusic = null; _backgroundChanel = null; this.Destroy(); } } }
public void Update() { this.width = game.width; this.height = game.height; if (_startButton.HitTestPoint(Input.mouseX, Input.mouseY)) { _startButton.texture.Load("HUD/start selected.png"); } else { _startButton.texture.Load("HUD/start.png"); } if (_quitButton.HitTestPoint(Input.mouseX, Input.mouseY)) { _quitButton.texture.Load("HUD/quit selected.png"); } else { _quitButton.texture.Load("HUD/quit.png"); } if (Input.GetMouseButtonDown(0)) { if (_startButton.HitTestPoint(Input.mouseX, Input.mouseY)) { StartGame(); } if (_quitButton.HitTestPoint(Input.mouseX, Input.mouseY)) { game.Destroy(); } } }