iFactory.Godot/BITKit/Scripts/UX/UXControl.cs

20 lines
446 B
C#
Raw Permalink Normal View History

2024-04-16 04:15:21 +08:00
using Godot;
using System;
using System.Collections.Generic;
namespace BITKit.UX
{
public partial class UXControl : Control
{
private readonly Queue<ImageTexture> _imageTextureQueue = new();
public void DrawTextureRect(ImageTexture texture)=>_imageTextureQueue.Enqueue(texture);
public override void _Draw()
{
while (_imageTextureQueue.TryDequeue(out var texture))
{
DrawTextureRect(texture, GetRect(), false);
}
}
}
}