public void label( String label ) { tfLabel.text( label ); }
public void label( String label, int color ) { tfLabel.text( label ); tfLabel.hardlight( color ); }
public void text( String value, int maxWidth ) { Highlighter hl = new Highlighter( value ); normal.text( hl.text ); normal.maxWidth = maxWidth; normal.measure(); if (hl.isHighlighted()) { normal.mask = hl.inverted(); highlighted.text( hl.text ); highlighted.maxWidth = maxWidth; highlighted.measure(); highlighted.mask = hl.mask; highlighted.visible = true; } else { highlighted.visible = false; } width = normal.width(); height = normal.height(); }
public TutorialItem( String text, int index, int width ) { super(); icon.frame( film.get( index ) ); label.text( text ); label.maxWidth = width - (int)icon.width() - GAP; label.measure(); height = Math.max( icon.height(), label.height() ) + GAP; }
public void text( String value, int maxWidth ) { Highlighter hl = new Highlighter( value ); normal.text( hl.text ); normal.maxWidth = maxWidth; normal.measure(); if (hl.isHighlighted()) { normal.mask = hl.inverted(); highlighted.text( hl.text ); highlighted.maxWidth = maxWidth; highlighted.measure(); highlighted.mask = hl.mask; highlighted.visible = true; } else { highlighted.visible = false; } width = normal.width(); height = normal.height(); }
info.text( desc.length() > 0 ? desc.toString() : TXT_NOTHING ); info.maxWidth = width; info.measure();
position.measure(); desc.text( rec.info ); desc.measure();
public WndInfoPlant( Plant plant ) { super(); IconTitle titlebar = new IconTitle(); titlebar.icon( new PlantSprite( plant.image ) ); titlebar.label( plant.plantName ); titlebar.setRect( 0, 0, WIDTH, 0 ); add( titlebar ); BitmapTextMultiline info = PixelScene.createMultiline( 6 ); add( info ); info.text( plant.desc() ); info.maxWidth = WIDTH; info.measure(); info.x = titlebar.left(); info.y = titlebar.bottom() + GAP; resize( WIDTH, (int)(info.y + info.height()) ); } }