Labs to LabelMap

This commit is contained in:
2026-06-13 23:37:19 +02:00
parent 99f9aab224
commit 80b19bd8bd
2 changed files with 3 additions and 3 deletions

View File

@@ -0,0 +1,43 @@
using System.Collections.Generic;
using System.Drawing;
namespace _2DGAMELIB
{
public class LabelMap
{
private OrderedDictionary<string, Lab> labs = new OrderedDictionary<string, Lab>();
private ModeEventDispatcher Med;
private RenderArea Are;
public Lab this[string Name] => labs[Name];
public LabelMap(ModeEventDispatcher Med, RenderArea Are)
{
this.Med = Med;
this.Are = Are;
}
public void Add(string Name, Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, Color TextColor, Color ShadColor, Color BackColor, Color FramColor, bool Input)
{
labs.Add(Name, new Lab(Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor));
}
public void Draw(RenderArea Are)
{
foreach (Lab value in labs.Values)
{
Are.Draw(value.ShapePartT);
}
}
public void Dispose()
{
foreach (Lab value in labs.Values)
{
value.Dispose();
}
}
}
}