Exemplo n.º 1
0
 public void Setup(Vector2 _position, Vector2 _size, UIRectDefinition _def)
 {
     dragFunc = defaultDragAction;
     SetPadding(0);
     position             = _position;
     mousePressedCallback = mousePressed_func;
     bg = new UIRect(_def, Vector2.Zero, _size);
     AddChild(bg);
     menubar = new UIButton(new Vector2(0, 0), new Vector2(bg.Size.X - 15, 12));
     menubar.mousePressedCallback = menuPressed_func;
     closeButton = new UIButton(new Vector2(bg.Size.X - 12, 0), new Vector2(12, 12), UIButton.Default_CloseButton);
     closeButton.mousePressedCallback = closePressed_func;
     AddChild(menubar);
     AddChild(closeButton);
     label = new UILabel("Window", new Vector2(10, 3), FontManager.UIFont, Color.White);
     AddChild(label);
 }
Exemplo n.º 2
0
 public UIWindow(Vector2 _position, Vector2 _size, UIRectDefinition _bgDef)
 {
     Setup(_position, _size, _bgDef);
 }
Exemplo n.º 3
0
 /**
  * Using rect defs for the constructor is the way to go!
  */
 public UIRect(UIRectDefinition _definition, Vector2 _position, Vector2 _size)
 {
     Setup(_definition.tex, _position, _size, _definition.srcrect, _definition.cornerSize);
 }