Files
Simplaudio/Scripts/SongDisplay.cs
T
Bucket Of Chicken e758d1df2b loading songs
2025-08-30 13:31:07 +02:00

26 lines
542 B
C#

using Godot;
using System;
using System.Linq;
public partial class SongDisplay : Control
{
public int DisplayId;
Song SavedInfo;
[Export] TextureRect background;
[Export] Label NameLabel;
[Export] Label ArtistLabel;
public void Setup(Song info){
SavedInfo = info;
Image image = info.LoadImage();
if (image != null){
ImageTexture tex = ImageTexture.CreateFromImage(image);
background.Texture = tex;
}
NameLabel.Text = SavedInfo.Name;
if (SavedInfo.Artists.Any()){
ArtistLabel.Text = SavedInfo.Artists[0];
}
}
}