Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 private void createDisabledImage()
 {
     disabledImage = new ImageLabel(0, 0, disabledTexture);
     disabledImage.resize(rect.Width, rect.Height);
 }
Ejemplo n.º 5
0
 public void endDrag()
 {
     dragIcon = null;
 }
Ejemplo n.º 6
0
 public void beginDrag(Texture2D _image)
 {
     dragIcon = new ImageLabel(0, 0, _image);
 }