Example #1
0
 public UIButton(Vector2 _position, Vector2 _size, UIButtonDef _def)
 {
     Setup(_def.type, _position, _size, _def.tex, _def.srcRect, _def.pressedOffset, _def.cornerSize, _def.pal);
 }
Example #2
0
 /**
  * This one is for labelled buttons
  */
 public UIButton(Vector2 _position, String _label, Vector2 _padding, BitmapFont _font, UIButtonDef _def)
 {
     Setup(_def.type, _position, _font.GetSize(_label) + _padding * 2, _def.tex, _def.srcRect, _def.pressedOffset, _def.cornerSize, _def.pal);
     label         = new UILabel(_label, _padding + new Vector2(0, -2), _font, Color.White);
     labelPosition = label.position;
     labelPadding  = _padding;
     AddChild(label);
 }