public BasicNode(BasicNodeStructure structure, RectangleRenderElementStyle border_style) { Structure = structure; BorderStyle = border_style; BorderElement = new RectangleRenderElement(Position, Width, Height, border_style.FillColor, border_style.BorderColor, border_style.BorderWidth); TriggerAreas.Add(new RectangleHitbox(Position, Width, Height)); }
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)); }; }