public LabelNode(BasicTextNodeStructure structure, TextRenderElementStyle text_style, RectangleRenderElementStyle border_style) : base(structure, border_style) { Structure = structure; TextStyle = text_style; TextElement = new TextRenderElement(Position, Text, text_style.Color, text_style.FontSize, text_style.FontStyle); }
public ButtonNode(ButtonStructure structure, RectangleRenderElementStyle style, TextRenderElementStyle text_style) { Structure = structure; BorderStyle = style; TextStyle = text_style; BorderElement = new RectangleRenderElement(Position, Width, Height, style.FillColor, style.BorderColor, style.BorderWidth); TextElement = new TextRenderElement(Position, Text, TextColor, TextStyle.FontSize, TextStyle.FontStyle); TriggerAreas.Add(new RectangleHitbox(Position, Width, Height)); ButtonAction = Structure.ButtonAction; OnMouseClick += (object sender, EventArgs e) => { ButtonAction.Invoke(); OnUnfocused?.Invoke(this, new NodeEventArgs(this)); }; }