mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-07 23:41:47 +02:00
Replace string element render types with RenderCommandType enum, decompose UI elements (Button, CheckBox, chrome) into drawing primitives via ToPrimitives(), emit per-element commands on flush, and move composite into IRenderSource.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using RemSox.UI.GUI.Rendering;
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace RemSox.UI.GUI.UIEelements.Shapes;
|
||||
@@ -21,4 +23,21 @@ public class Text() : UIElement("Text")
|
||||
get;
|
||||
set => SetProperty(nameof(FontSize), ref field, value);
|
||||
} = 12;
|
||||
|
||||
public override IEnumerable<RenderCommand> ToPrimitives(int windowId)
|
||||
{
|
||||
yield return new RenderCommand
|
||||
{
|
||||
WindowId = windowId,
|
||||
ElementId = PrimitiveId(0),
|
||||
Type = RenderCommandType.DrawText,
|
||||
Position = Position,
|
||||
Properties = new Dictionary<string, object?>
|
||||
{
|
||||
["Color"] = Color,
|
||||
["Content"] = Content,
|
||||
["FontSize"] = FontSize,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user