Exemple #1
0
 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);
 }
Exemple #2
0
 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));
     };
 }