public override void _PhysicsProcess(float delta) { if (Input.IsActionJustPressed("ui_pause")) { this.Hide(); GetTree().Paused = false; } cont = (TextureButton)GetChild(0).GetChild(0).GetNode("Continue"); start = (TextureButton)GetChild(0).GetChild(0).GetNode("Start"); quit = (TextureButton)GetChild(0).GetChild(0).GetNode("Quit"); if (cont.IsHovered()) { cont.GrabFocus(); } if (start.IsHovered()) { start.GrabFocus(); } if (quit.IsHovered()) { quit.GrabFocus(); } }
public void GUIControls() { cont = (TextureButton)GetChild(0).GetChild(1).GetChild(0).GetChild(1).GetNode("Continue"); start = (TextureButton)GetChild(0).GetChild(1).GetChild(0).GetChild(1).GetNode("Start"); quit = (TextureButton)GetChild(0).GetChild(1).GetChild(0).GetChild(1).GetNode("Quit"); if (start.IsHovered()) { start.GrabFocus(); } if (quit.IsHovered()) { quit.GrabFocus(); } }
public override void _Input(InputEvent @event) { if (click) { if (@event is InputEventScreenTouch) { TextureButton tbt = (TextureButton)GetNode("Bt_saveandexit"); if (!tbt.IsHovered()) { globale.chargement("res://levels/World.tscn"); //GetTree().ChangeScene("res://levels/World.tscn"); } } else if (@event is InputEventKey ie) { if (Input.IsActionPressed("jump")) { globale.chargement("res://levels/World.tscn"); //GetTree().ChangeScene("res://levels/World.tscn"); } } } }