public float getScrollBarWidth () { if (!scrollY) return 0; float width = 0; if (style.vScrollKnob != null) width = style.vScrollKnob.getMinWidth(); if (style.vScroll != null) width = Math.max(width, style.vScroll.getMinWidth()); return width; }
public float getPrefWidth () { float width = super.getPrefWidth(); if (style.up != null) width = Math.max(width, style.up.getMinWidth()); if (style.down != null) width = Math.max(width, style.down.getMinWidth()); if (style.checked != null) width = Math.max(width, style.checked.getMinWidth()); return width; }
public float getPrefWidth () { if (vertical) { final Drawable knob = getKnobDrawable(); final Drawable bg = (disabled && style.disabledBackground != null) ? style.disabledBackground : style.background; return Math.max(knob == null ? 0 : knob.getMinWidth(), bg == null ? 0 : bg.getMinWidth()); } else return 140; }
public float getPrefWidth () { if (vertical) { final Drawable knob = getKnobDrawable(); final Drawable bg = (disabled && style.disabledBackground != null) ? style.disabledBackground : style.background; return Math.max(knob == null ? 0 : knob.getMinWidth(), bg == null ? 0 : bg.getMinWidth()); } else return 140; }
public void layout () { if (sizeInvalid) computeSize(); float plusMinusWidth = Math.max(style.plus.getMinWidth(), style.minus.getMinWidth()); layout(rootNodes, padding, getHeight() - ySpacing / 2, plusMinusWidth); }
public void layout () { if (sizeInvalid) computeSize(); float plusMinusWidth = Math.max(style.plus.getMinWidth(), style.minus.getMinWidth()); layout(rootNodes, padding, getHeight() - ySpacing / 2, plusMinusWidth); }
public float getMinWidth () { float first = firstWidget instanceof Layout ? ((Layout)firstWidget).getMinWidth() : 0; float second = secondWidget instanceof Layout ? ((Layout)secondWidget).getMinWidth() : 0; if (vertical) return Math.max(first, second); return first + style.handle.getMinWidth() + second; }
public float getMinWidth () { float first = firstWidget instanceof Layout ? ((Layout)firstWidget).getMinWidth() : 0; float second = secondWidget instanceof Layout ? ((Layout)secondWidget).getMinWidth() : 0; if (vertical) return Math.max(first, second); return first + style.handle.getMinWidth() + second; }
public void draw (Batch batch, float parentAlpha) { drawBackground(batch, parentAlpha); Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); float plusMinusWidth = Math.max(style.plus.getMinWidth(), style.minus.getMinWidth()); draw(batch, rootNodes, padding, plusMinusWidth); super.draw(batch, parentAlpha); // Draw actors. }
private void calculateHorizBoundsAndPositions () { Drawable handle = style.handle; float height = getHeight(); float availWidth = getWidth() - handle.getMinWidth(); float leftAreaWidth = (int)(availWidth * splitAmount); float rightAreaWidth = availWidth - leftAreaWidth; float handleWidth = handle.getMinWidth(); firstWidgetBounds.set(0, 0, leftAreaWidth, height); secondWidgetBounds.set(leftAreaWidth + handleWidth, 0, rightAreaWidth, height); handleBounds.set(leftAreaWidth, 0, handleWidth, height); }
public float getPrefWidth () { float v = prefWidth.get(actor); if (background != null) v = Math.max(v, background.getMinWidth()); return Math.max(getMinWidth(), v + padLeft.get(this) + padRight.get(this)); }
private void calculateHorizBoundsAndPositions () { Drawable handle = style.handle; float height = getHeight(); float availWidth = getWidth() - handle.getMinWidth(); float leftAreaWidth = (int)(availWidth * splitAmount); float rightAreaWidth = availWidth - leftAreaWidth; float handleWidth = handle.getMinWidth(); firstWidgetBounds.set(0, 0, leftAreaWidth, height); secondWidgetBounds.set(leftAreaWidth + handleWidth, 0, rightAreaWidth, height); handleBounds.set(leftAreaWidth, 0, handleWidth, height); }
public float getPrefWidth () { float v = prefWidth.get(actor); if (background != null) v = Math.max(v, background.getMinWidth()); return Math.max(getMinWidth(), v + padLeft.get(this) + padRight.get(this)); }
@Override public float getPrefWidth () { float first = firstWidget == null ? 0 : (firstWidget instanceof Layout ? ((Layout)firstWidget).getPrefWidth() : firstWidget.getWidth()); float second = secondWidget == null ? 0 : (secondWidget instanceof Layout ? ((Layout)secondWidget).getPrefWidth() : secondWidget.getWidth()); if (vertical) return Math.max(first, second); return first + style.handle.getMinWidth() + second; }
@Override public float getPrefWidth () { float first = firstWidget == null ? 0 : (firstWidget instanceof Layout ? ((Layout)firstWidget).getPrefWidth() : firstWidget.getWidth()); float second = secondWidget == null ? 0 : (secondWidget instanceof Layout ? ((Layout)secondWidget).getPrefWidth() : secondWidget.getWidth()); if (vertical) return Math.max(first, second); return first + style.handle.getMinWidth() + second; }
protected void drawCursor (Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y) { cursorPatch.draw(batch, x + textOffset + glyphPositions.get(cursor) - glyphPositions.get(visibleTextStart) + fontOffset + font.getData().cursorX, y - textHeight - font.getDescent(), cursorPatch.getMinWidth(), textHeight); }
/** Sets a new drawable for the image. The image's pref size is the drawable's min size. If using the image actor's size rather * than the pref size, {@link #pack()} can be used to size the image to its pref size. * @param drawable May be null. */ public void setDrawable (Drawable drawable) { if (this.drawable == drawable) return; if (drawable != null) { if (getPrefWidth() != drawable.getMinWidth() || getPrefHeight() != drawable.getMinHeight()) invalidateHierarchy(); } else invalidateHierarchy(); this.drawable = drawable; }
/** Sets a new drawable for the image. The image's pref size is the drawable's min size. If using the image actor's size rather * than the pref size, {@link #pack()} can be used to size the image to its pref size. * @param drawable May be null. */ public void setDrawable (Drawable drawable) { if (this.drawable == drawable) return; if (drawable != null) { if (getPrefWidth() != drawable.getMinWidth() || getPrefHeight() != drawable.getMinHeight()) invalidateHierarchy(); } else invalidateHierarchy(); this.drawable = drawable; }
@Override protected void drawCursor (Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y) { float textOffset = cursor >= glyphPositions.size || cursorLine * 2 >= linesBreak.size ? 0 : glyphPositions.get(cursor) - glyphPositions.get(linesBreak.items[cursorLine * 2]); cursorPatch.draw(batch, x + textOffset + fontOffset + font.getData().cursorX, y - font.getDescent() / 2 - (cursorLine - firstLineShowing + 1) * font.getLineHeight(), cursorPatch.getMinWidth(), font.getLineHeight()); }
@Override protected void drawCursor (Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y) { float textOffset = cursor >= glyphPositions.size || cursorLine * 2 >= linesBreak.size ? 0 : glyphPositions.get(cursor) - glyphPositions.get(linesBreak.items[cursorLine * 2]); cursorPatch.draw(batch, x + textOffset + fontOffset + font.getData().cursorX, y - font.getDescent() / 2 - (cursorLine - firstLineShowing + 1) * font.getLineHeight(), cursorPatch.getMinWidth(), font.getLineHeight()); }