Esempio n. 1
0
 public void setStyle(ButtonStyle style) {
   if (!(style instanceof ImageTextButtonStyle))
     throw new IllegalArgumentException("style must be a ImageTextButtonStyle.");
   super.setStyle(style);
   this.style = (ImageTextButtonStyle) style;
   if (image != null) updateImage();
   if (label != null) {
     ImageTextButtonStyle textButtonStyle = (ImageTextButtonStyle) style;
     LabelStyle labelStyle = label.getStyle();
     labelStyle.font = textButtonStyle.font;
     labelStyle.fontColor = textButtonStyle.fontColor;
     label.setStyle(labelStyle);
   }
 }
Esempio n. 2
0
 public void draw(SpriteBatch batch, float parentAlpha) {
   updateImage();
   Color fontColor;
   if (isDisabled && style.disabledFontColor != null) fontColor = style.disabledFontColor;
   else if (isPressed() && style.downFontColor != null) fontColor = style.downFontColor;
   else if (isChecked && style.checkedFontColor != null)
     fontColor =
         (isOver() && style.checkedOverFontColor != null)
             ? style.checkedOverFontColor
             : style.checkedFontColor;
   else if (isOver() && style.overFontColor != null) fontColor = style.overFontColor;
   else fontColor = style.fontColor;
   if (fontColor != null) label.getStyle().fontColor = fontColor;
   super.draw(batch, parentAlpha);
 }
Esempio n. 3
0
 /**
  * sets the border of the tooltip, the default border is 4px.
  *
  * @param theValue
  * @return Tooltip
  */
 public Tooltip setBorder(int theValue) {
   borderSize = theValue;
   label.getStyle().setMargin(borderSize, borderSize, borderSize, borderSize);
   return this;
 }
Esempio n. 4
0
 /**
  * sets the border of the tooltip, the default border is 4px.
  *
  * @param theValue
  * @return Tooltip
  */
 public Tooltip setBorder(int theValue) {
   _myBorder = theValue;
   _myLabel.getStyle().setMargin(_myBorder, _myBorder, _myBorder, _myBorder);
   return this;
 }