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(); } }
private void ShowGameOver(object sender, EventArgs e) { if (bird.State == BirdStates.Ground) { ButtonPlay.GrabFocus(); Show(); player.Play("GameOverAnimation"); } }
// Member variables here, example: // private int a = 2; // private string b = "textvar"; // public override void _Ready() { } public override void _PhysicsProcess(float delta) { if (Input.IsActionPressed("ui_pause")) { GetTree().Paused = true; GetNode <Control>("InGameMenu").Show(); cont = (TextureButton)GetNode <Control>("InGameMenu").GetChild(0).GetChild(0).GetNode("Continue"); cont.GrabFocus(); GetNode <AnimatedSprite>("EnemyTwo2").FlipH = true;; } }
public override void _Ready() { _ui = GetNode <Control>("UI"); _main = _ui.GetNode <Control>(@"Main"); _playButton = _main.GetNode <TextureButton>(@"Play"); _settingsButton = _main.GetNode <TextureButton>(@"Settings"); _quitButton = _main.GetNode <TextureButton>(@"Quit"); _settingsMenu = _ui.GetNode <Control>(@"Settings"); _settingsActions = _settingsMenu.GetNode <Control>(@"Actions"); _settingsActionApply = _settingsActions.GetNode <Control>(@"Apply"); _settingsActionCancel = _settingsActions.GetNode <Control>(@"Cancel"); _giMenu = _settingsMenu.GetNode <Control>(@"GI"); _giHigh = _giMenu.GetNode <Button>(@"High"); _giLow = _giMenu.GetNode <Button>(@"Low"); _giDisabled = _giMenu.GetNode <Button>(@"Disabled"); _aaMenu = _settingsMenu.GetNode <Control>(@"AA"); _aa8x = _aaMenu.GetNode <Button>(@"8X"); _aa4x = _aaMenu.GetNode <Button>(@"4X"); _aa2x = _aaMenu.GetNode <Button>(@"2X"); _aaDisabled = _aaMenu.GetNode <Button>(@"Disabled"); _ssaoMenu = _settingsMenu.GetNode <Control>(@"SSAO"); _ssaoHigh = _ssaoMenu.GetNode <Button>(@"High"); _ssaoLow = _ssaoMenu.GetNode <Button>(@"Low"); _ssaoDisabled = _ssaoMenu.GetNode <Button>(@"Disabled"); _bloomMenu = _settingsMenu.GetNode <Control>(@"Bloom"); _bloomHigh = _bloomMenu.GetNode <Button>(@"High"); _bloomLow = _bloomMenu.GetNode <Button>(@"Low"); _bloomDisabled = _bloomMenu.GetNode <Button>(@"Disabled"); _resolutionMenu = _settingsMenu.GetNode <Control>(@"Resolution"); _resolutionNative = _resolutionMenu.GetNode <Button>(@"Native"); _resolution1080 = _resolutionMenu.GetNode <Button>(@"1080"); _resolution720 = _resolutionMenu.GetNode <Button>(@"720"); _resolution540 = _resolutionMenu.GetNode <Button>(@"540"); _fullscreenMenu = _settingsMenu.GetNode <Control>(@"Fullscreen"); _fullscreenYes = _fullscreenMenu.GetNode <Button>(@"Yes"); _fullscreenNo = _fullscreenMenu.GetNode <Button>(@"No"); _loading = _ui.GetNode <Control>(@"Loading"); _loadingProgress = _loading.GetNode <ProgressBar>(@"Progress"); _loadingDoneTimer = _loading.GetNode <Timer>(@"DoneTimer"); GetTree().SetScreenStretch(SceneTree.StretchMode.Mode2d, SceneTree.StretchAspect.Keep, new Vector2(1920, 1080)); _playButton.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(); } }
private void _on_apply_pressed() { _main.Show(); _playButton.GrabFocus(); _settingsMenu.Hide(); var settings = GetNode <Settings>("/root/Settings"); if (_giHigh.Pressed) { settings.GIQuality = Settings.GIQualityEnum.High; } else if (_giLow.Pressed) { settings.GIQuality = Settings.GIQualityEnum.Low; } else if (_giDisabled.Pressed) { settings.GIQuality = Settings.GIQualityEnum.Disabled; } if (_aa8x.Pressed) { settings.AAQuality = Settings.AAQualityEnum.AA_8x; } else if (_aa4x.Pressed) { settings.AAQuality = Settings.AAQualityEnum.AA_4x; } else if (_aa2x.Pressed) { settings.AAQuality = Settings.AAQualityEnum.AA_2x; } else if (_aaDisabled.Pressed) { settings.AAQuality = Settings.AAQualityEnum.Disabled; } if (_ssaoHigh.Pressed) { settings.SSAOQuality = Settings.SSAOQualityEnum.High; } if (_ssaoLow.Pressed) { settings.SSAOQuality = Settings.SSAOQualityEnum.Low; } if (_ssaoDisabled.Pressed) { settings.SSAOQuality = Settings.SSAOQualityEnum.Disabled; } if (_bloomHigh.Pressed) { settings.BloomQuality = Settings.BloomQualityEnum.High; } else if (_bloomLow.Pressed) { settings.BloomQuality = Settings.BloomQualityEnum.Low; } else if (_bloomDisabled.Pressed) { settings.BloomQuality = Settings.BloomQualityEnum.Disabled; } if (_resolutionNative.Pressed) { settings.Resolution = Settings.ResolutionEnum.Native; } else if (_resolution1080.Pressed) { settings.Resolution = Settings.ResolutionEnum.Res_1080; } else if (_resolution720.Pressed) { settings.Resolution = Settings.ResolutionEnum.Res_720; } else if (_resolution540.Pressed) { settings.Resolution = Settings.ResolutionEnum.Res_540; } settings.Fullscreen = _fullscreenYes.Pressed; // Apply the setting directly OS.WindowFullscreen = settings.Fullscreen; settings.SaveSettings(); }
public override void _Ready() { start = (TextureButton)GetChild(0).GetChild(1).GetChild(0).GetChild(1).GetNode("Start"); start.GrabFocus(); }