Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public TextBoxNode(BasicTextNodeStructure structure, TextRenderElementStyle text_style,
                    RectangleRenderElementStyle border_style) : base(structure, text_style, border_style)
 {
     TriggerAreas.Add(new RectangleHitbox(Position, Width, Height));
     OnKeyPress  += HandleKey;
     OnFocused   += (sender, args) => FillColor = Color.CadetBlue;
     OnUnfocused += (sender, args) => FillColor = Color.White;
 }
Ejemplo n.º 3
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));
     };
 }