private float lastPrefHeight;\r
private boolean sizeInvalid = true;\r
private float fontScaleX = 1, fontScaleY = 1;\r
+ private boolean ellipse = true;\r
\r
public Label (CharSequence text, Skin skin) {\r
this(text, skin.get(LabelStyle.class));\r
\r
float width = getWidth(), height = getHeight();\r
StringBuilder text;\r
- if (width < bounds.width) {\r
+ if (ellipse && width < bounds.width) {\r
float ellipseWidth = font.getBounds("...").width;\r
text = tempText != null ? tempText : (tempText = new StringBuilder());\r
text.setLength(0);\r
invalidateHierarchy();\r
}\r
\r
+ /** When true the text will be truncated with an ellipse if it does not fit within the width of the label. Default is true. */\r
+ public void setEllipse (boolean ellipse) {\r
+ this.ellipse = ellipse;\r
+ }\r
+\r
/** The style for a label, see {@link Label}.\r
* @author Nathan Sweet */\r
static public class LabelStyle {\r