This repository has been archived on 2025-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
Files
skolavdf/phr/StickGame/Assets/UI/InfoText.cs
2024-03-24 22:21:16 +01:00

28 lines
676 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class InfoText : VisualElement
{
[UnityEngine.Scripting.Preserve]
public new class UxmlFactory : UxmlFactory<InfoText> { }
const string styleSheetPath = "Default";
const string ussInfoText = "InfoText";
Label label = new Label() { text = "Some text to fill this thing" };
public InfoText()
{
styleSheets.Add(Resources.Load<StyleSheet>(styleSheetPath));
AddToClassList(ussInfoText);
Add(label);
}
public void SetText(string text)
{
label.text = text;
}
}