functional card/row edit and drag

This commit is contained in:
2024-04-23 23:31:42 -05:00
parent 8e01e9cb9b
commit 56dcbb62af
29 changed files with 674 additions and 48 deletions

View File

@@ -0,0 +1,29 @@
using Godot;
using System;
using System.Data.Common;
using System.Linq;
using System.Text.Json.Serialization;
public class SerialCard
{
[JsonInclude]
public string Text { get; set; }
[JsonInclude]
public SerialImage Image { get; set; }
public card ToCard(SceneTree tree)
{
var c = card.MakeCard(tree);
c.CardName = Text;
if (Image.DataWebp.Any())
{
var iwm = Image.ToImageWithMetadata();
c.SetTexture(ImageTexture.CreateFromImage(iwm.Image));
c.SetStretchMode(iwm.StretchMode);
}
else
{
c.SetStretchMode(Image.StretchMode);
}
return c;
}
}