Added tooltip to nodes to better explain their functionality.
Readded node deletion.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user