Ejemplo 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);
   }
 }
Ejemplo 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);
 }
Ejemplo 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;
 }
Ejemplo 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;
 }