public float width () { return size.width(); } public float height () { return size.height(); }
public TextLogger(float wid, int lines, TextFormat format) { super(wid, game.graphics.layoutText(".", format).size.height() * lines, format); this.lineCount = lines; }
public float labelWidth () { return llayout.size.width(); } public IDimension size () { return _size; }
public TextMapper(float wid, int lines, TextFormat format) { super(wid, game.graphics.layoutText(".", format).size.height() * lines, format); }
/** * Creates a canvas layer with a backing canvas of {@code size} (in display units). This layer * will display nothing until a {@link #begin}/{@link #end} pair is used to render something to * its backing canvas. */ public CanvasLayer (Graphics gfx, IDimension size) { this(gfx, size.width(), size.height()); }
public void onEmit (Throwable err) { addDescrip("Error: " + err.getMessage(), 10, errY, game.graphics.viewSize.width()-20); errY += 30; } };
@Override public float height () { return style.effect.adjustHeight(_layout.size.height()); }
@Override public float width () { return style.effect.adjustWidth(_layout.size.width()); } @Override public float height () {
/** Sizes this root element to the specified width and its preferred height. */ public Root packToWidth (float width) { IDimension psize = preferredSize(width, 0); setSize(width, psize.height()); return this; }
/** Sizes this root element to the specified height and its preferred width. */ public Root packToHeight (float height) { IDimension psize = preferredSize(0, height); setSize(psize.width(), height); return this; }
public void update (Screen oscreen, Screen nscreen, float pct) { float oheight = oscreen.size().height(); float ostart = 0, nstart = oheight, range = -oheight; float offset = pct * range; oscreen.layer.setTy(ostart + offset); nscreen.layer.setTy(nstart + offset); } };
protected void displayText (String text) { output.setTile(game.ui.wrapText(text, game.graphics.viewSize.width()-20, TextBlock.Align.LEFT)); }
/** * Updates the value to a new dimension with the current height and the given width. */ public void updateWidth (float width) { update(new Dimension(width, get().height())); }
public void update (Screen oscreen, Screen nscreen, float pct) { float nwidth = nscreen.size().width(); float ostart = 0, nstart = -nwidth, range = nwidth; float offset = pct * range; oscreen.layer.setTx(ostart + offset); nscreen.layer.setTx(nstart + offset); } };
public void update (Screen oscreen, Screen nscreen, float pct) { float nheight = nscreen.size().height(); float ostart = 0, nstart = -nheight, range = nheight; float offset = pct * range; oscreen.layer.setTy(ostart + offset); nscreen.layer.setTy(nstart + offset); } };