public LabeledTab( String label ) { super(); btLabel.text( label ); }
public LabeledTab( String label ) { super(); btLabel.text( label ); }
public void text( String value ) { text.text( value ); layout(); }
public void text( String value ) { text.text( value ); layout(); }
public float reqHeight() { float reqHeight = 0; if (icon != null){ reqHeight = Math.max(icon.height() + 4, reqHeight); } if (text != null && !text.text().equals("")){ reqHeight = Math.max(text.baseLine() + 4, reqHeight); } return reqHeight; } }
public OptionSlider(String title, String minTxt, String maxTxt, int minVal, int maxVal){ super(); //shouldn't function if this happens. if (minVal > maxVal){ minVal = maxVal; active = false; } this.title.text(title); this.minTxt.text(minTxt); this.maxTxt.text(maxTxt); this.minVal = minVal; this.maxVal = maxVal; sliderTicks = new ColorBlock[(maxVal - minVal) + 1]; for (int i = 0; i < sliderTicks.length; i++){ add(sliderTicks[i] = new ColorBlock(1, 11, 0xFF222222)); } add(sliderNode); }
public float reqHeight() { float reqHeight = 0; if (icon != null){ reqHeight = Math.max(icon.height() + 4, reqHeight); } if (text != null && !text.text().equals("")){ reqHeight = Math.max(text.baseLine() + 4, reqHeight); } return reqHeight; } }
public OptionSlider(String title, String minTxt, String maxTxt, int minVal, int maxVal){ super(); //shouldn't function if this happens. if (minVal > maxVal){ minVal = maxVal; active = false; } this.title.text(title); this.minTxt.text(minTxt); this.maxTxt.text(maxTxt); this.minVal = minVal; this.maxVal = maxVal; sliderTicks = new ColorBlock[(maxVal - minVal) + 1]; for (int i = 0; i < sliderTicks.length; i++){ add(sliderTicks[i] = new ColorBlock(1, 11, 0xFF222222)); } add(sliderNode); }
public float reqWidth() { float reqWidth = 0; if (icon != null){ reqWidth += icon.width() + 2; } if (text != null && !text.text().equals("")){ reqWidth += text.width() + 2; } return reqWidth; }
public float reqWidth() { float reqWidth = 0; if (icon != null){ reqWidth += icon.width() + 2; } if (text != null && !text.text().equals("")){ reqWidth += text.width() + 2; } return reqWidth; }
public RedButton( String label, int size ){ super(); text = PixelScene.renderText( size ); text.text( label ); add( text ); }
public RedButton( String label, int size ){ super(); text = PixelScene.renderText( size ); text.text( label ); add( text ); }
public ListItem( Badges.Badge badge ) { super(); this.badge = badge; icon.copy( BadgeBanner.image( badge.image )); label.text( badge.desc() ); }
public DashboardItem( String text, int index ) { super(); image.frame( image.texture.uvRect( index * IMAGE_SIZE, 0, (index + 1) * IMAGE_SIZE, IMAGE_SIZE ) ); this.label.text( text ); setSize( SIZE, SIZE ); }
public DashboardItem( String text, int index ) { super(); image.frame( image.texture.uvRect( index * IMAGE_SIZE, 0, (index + 1) * IMAGE_SIZE, IMAGE_SIZE ) ); this.label.text( text ); setSize( SIZE, SIZE ); }
public ListItem( Badges.Badge badge ) { super(); this.badge = badge; icon.copy( BadgeBanner.image( badge.image )); label.text( badge.desc() ); }
@Override protected void layout() { bg.x = x; bg.y = y; slot.setRect( x, y, HEIGHT, HEIGHT ); PixelScene.align(slot); name.x = slot.right() + 2; name.y = y + (height - name.baseLine()) / 2; PixelScene.align(name); String str = Messages.titleCase( item.name() ); name.text( str ); if (name.width() > width - name.x) { do { str = str.substring( 0, str.length() - 1 ); name.text( str + "..." ); } while (name.width() > width - name.x); } super.layout(); }
@Override protected void layout() { bg.x = x; bg.y = y; slot.setRect( x, y, HEIGHT, HEIGHT ); PixelScene.align(slot); name.x = slot.right() + 2; name.y = y + (height - name.baseLine()) / 2; PixelScene.align(name); String str = Messages.titleCase( item.name() ); name.text( str ); if (name.width() > width - name.x) { do { str = str.substring( 0, str.length() - 1 ); name.text( str + "..." ); } while (name.width() > width - name.x); } super.layout(); }
@Override protected void layout() { super.layout(); bg.x = x; bg.y = y; bg.size( width, height ); float componentWidth = 0; if (icon != null) componentWidth += icon.width() + 2; if (text != null && !text.text().equals("")){ componentWidth += text.width() + 2; text.x = x + (width() - componentWidth)/2f + 1; text.y = y + (height() - text.baseLine()) / 2f; PixelScene.align(text); } if (icon != null) { icon.x = x + (width() + componentWidth)/2f - icon.width() - 1; icon.y = y + (height() - icon.height()) / 2f; PixelScene.align(icon); } }
output.visible = true; energyCost.text( Messages.get(AlchemyScene.class, "cost", cost) ); energyCost.y = btnCombine.top() - energyCost.baseLine(); energyCost.x = btnCombine.left() + (btnCombine.width() - energyCost.width())/2;