// Called when the node enters the scene tree for the first time. public override void _Ready() { Player = (Player)GetTree().CurrentScene.FindNode("Player"); acceptDialog = (MyAcceptDialog)GetNode("MyAcceptDialog"); GameState.Info.Scale = new Vector2(1, 1); GameState.Info.DisplayStats(); }
/// <summary>Displays a popup next to the Player.</summary> /// <param name="acceptDialog">Instance of MyAcceptDialog</param> /// <param name="text">Text to be displayed</param> /// <param name="displayTime">Duration for the text to be displayed</param> internal static void DisplayPopup(MyAcceptDialog acceptDialog, Player player, string text, float displayTime = 0.75f) { acceptDialog.Popup_(); acceptDialog.SetExpiration(displayTime); acceptDialog.DialogText = text; acceptDialog.SetSize(new Vector2(84f, 128f)); acceptDialog.SetGlobalPosition(new Vector2(player.GlobalPosition.x + 32, player.GlobalPosition.y - 32)); Info.DisplayStats(); }