588879951d
Readded node deletion.
25 lines
564 B
C#
25 lines
564 B
C#
using Godot;
|
|
|
|
public partial class NodeTooltip : PanelContainer
|
|
{
|
|
[Export] RichTextLabel title;
|
|
[Export] TextureRect image;
|
|
[Export] RichTextLabel description;
|
|
|
|
private static Vector2 spacing = new Vector2(5, 0);
|
|
|
|
public void ShowTooltip(string titleText, string descriptionText, Button button)
|
|
{
|
|
title.Text = titleText;
|
|
image.Texture = ResourceLoader.LoadDSLTooltip(titleText);
|
|
description.Text = descriptionText;
|
|
Show();
|
|
Position = button.GlobalPosition - spacing - new Vector2(Size.X, Size.Y/2);
|
|
}
|
|
|
|
public void HideTooltip()
|
|
{
|
|
Hide();
|
|
}
|
|
}
|