public PushButton(int x, int y, Texture2D _upImage, Texture2D _downImage, Texture2D _image) : base(x, y, _upImage.Width, _upImage.Height) { upImage = new ImageLabel(0, 0, _upImage); downImage = new ImageLabel(0, 0, _downImage); labelOffset = new Point((rect.Width - _image.Width) / 2, (rect.Height - _image.Height) / 2); label = new ImageLabel(0, 0, _image); createDisabledImage(); }
private ImageLabel upImage, downImage; //button texture or background #endregion Fields #region Constructors public PushButton(int x, int y, Texture2D _upImage, Texture2D _downImage, string _text) : base(x, y, _upImage.Width,_upImage.Height) { upImage = new ImageLabel(0, 0, _upImage); downImage = new ImageLabel(0, 0, _downImage); labelOffset = new Point(0, 0); label = new TextLabel(0, 0, rect.Width, rect.Height, _text, Color.Beige); createDisabledImage(); }
public CheckBox(int x, int y, Texture2D _checkedImage,Texture2D _unCheckedImage, string _text, bool _isChecked) : base(x, y, 0, 0, _text) { isChecked = _isChecked; checkedImage = new ImageLabel(0, 0, _checkedImage); unCheckedImage = new ImageLabel(0, 0, _unCheckedImage); setClickEventHandler(onClicked); label.resize(((TextLabel)label).getTextWidth(), checkedImage.getHeight()); labelOffset.X = _checkedImage.Width + 5; rect.Width = labelOffset.X + ((TextLabel)label).getTextWidth(); rect.Height = _checkedImage.Height; }
private void createDisabledImage() { disabledImage = new ImageLabel(0, 0, disabledTexture); disabledImage.resize(rect.Width, rect.Height); }
public void endDrag() { dragIcon = null; }
public void beginDrag(Texture2D _image) { dragIcon = new ImageLabel(0, 0, _image); }