public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getTopHeight(); } };
public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getTopHeight(); } };
@Override protected float getTextY (BitmapFont font, Drawable background) { float textY = getHeight(); if (background != null) { textY = (int)(textY - background.getTopHeight()); } return textY; }
@Override protected float getTextY (BitmapFont font, Drawable background) { float textY = getHeight(); if (background != null) { textY = (int)(textY - background.getTopHeight()); } return textY; }
@Override protected void sizeChanged () { lastText = null; // Cause calculateOffsets to recalculate the line breaks. // The number of lines showed must be updated whenever the height is updated BitmapFont font = style.font; Drawable background = style.background; float availableHeight = getHeight() - (background == null ? 0 : background.getBottomHeight() + background.getTopHeight()); linesShowing = (int)Math.floor(availableHeight / font.getLineHeight()); }
@Override protected void sizeChanged () { lastText = null; // Cause calculateOffsets to recalculate the line breaks. // The number of lines showed must be updated whenever the height is updated BitmapFont font = style.font; Drawable background = style.background; float availableHeight = getHeight() - (background == null ? 0 : background.getBottomHeight() + background.getTopHeight()); linesShowing = (int)Math.floor(availableHeight / font.getLineHeight()); }
@Override public float getPrefHeight () { if (prefRows <= 0) { return super.getPrefHeight(); } else { float prefHeight = textHeight * prefRows; if (style.background != null) { prefHeight = Math.max(prefHeight + style.background.getBottomHeight() + style.background.getTopHeight(), style.background.getMinHeight()); } return prefHeight; } }
@Override public float getPrefHeight () { if (prefRows <= 0) { return super.getPrefHeight(); } else { float prefHeight = textHeight * prefRows; if (style.background != null) { prefHeight = Math.max(prefHeight + style.background.getBottomHeight() + style.background.getTopHeight(), style.background.getMinHeight()); } return prefHeight; } }
/** @return -1 if not over an item. */ public int getItemIndexAt (float y) { float height = getHeight(); Drawable background = List.this.style.background; if (background != null) { height -= background.getTopHeight() + background.getBottomHeight(); y -= background.getBottomHeight(); } int index = (int)((height - y) / itemHeight); if (index < 0 || index >= items.size) return -1; return index; }
/** @return -1 if not over an item. */ public int getItemIndexAt (float y) { float height = getHeight(); Drawable background = List.this.style.background; if (background != null) { height -= background.getTopHeight() + background.getBottomHeight(); y -= background.getBottomHeight(); } int index = (int)((height - y) / itemHeight); if (index < 0 || index >= items.size) return -1; return index; }
public float getPrefHeight () { if (widget instanceof Layout) { float height = ((Layout)widget).getPrefHeight(); if (style.background != null) height += style.background.getTopHeight() + style.background.getBottomHeight(); if (forceScrollX) { float scrollbarHeight = 0; if (style.hScrollKnob != null) scrollbarHeight = style.hScrollKnob.getMinHeight(); if (style.hScroll != null) scrollbarHeight = Math.max(scrollbarHeight, style.hScroll.getMinHeight()); height += scrollbarHeight; } return height; } return 150; }
public float getPrefHeight () { if (widget instanceof Layout) { float height = ((Layout)widget).getPrefHeight(); if (style.background != null) height += style.background.getTopHeight() + style.background.getBottomHeight(); if (forceScrollX) { float scrollbarHeight = 0; if (style.hScrollKnob != null) scrollbarHeight = style.hScrollKnob.getMinHeight(); if (style.hScroll != null) scrollbarHeight = Math.max(scrollbarHeight, style.hScroll.getMinHeight()); height += scrollbarHeight; } return height; } return 150; }
protected float getTextY (BitmapFont font, Drawable background) { float height = getHeight(); float textY = textHeight / 2 + font.getDescent(); if (background != null) { float bottom = background.getBottomHeight(); textY = textY + (height - background.getTopHeight() - bottom) / 2 + bottom; } else { textY = textY + height / 2; } if (font.usesIntegerPositions()) textY = (int)textY; return textY; }
public float getPrefHeight () { if (prefSizeInvalid) scaleAndComputePrefSize(); float descentScaleCorrection = 1; if (fontScaleChanged) descentScaleCorrection = fontScaleY / style.font.getScaleY(); float height = prefSize.y - style.font.getDescent() * descentScaleCorrection * 2; Drawable background = style.background; if (background != null) height += background.getTopHeight() + background.getBottomHeight(); return height; }
protected float getTextY (BitmapFont font, Drawable background) { float height = getHeight(); float textY = textHeight / 2 + font.getDescent(); if (background != null) { float bottom = background.getBottomHeight(); textY = textY + (height - background.getTopHeight() - bottom) / 2 + bottom; } else { textY = textY + height / 2; } if (font.usesIntegerPositions()) textY = (int)textY; return textY; }
public float getPrefHeight () { if (prefSizeInvalid) scaleAndComputePrefSize(); float descentScaleCorrection = 1; if (fontScaleChanged) descentScaleCorrection = fontScaleY / style.font.getScaleY(); float height = prefSize.y - style.font.getDescent() * descentScaleCorrection * 2; Drawable background = style.background; if (background != null) height += background.getTopHeight() + background.getBottomHeight(); return height; }
/** Creates a new empty drawable with the same sizing information as the specified drawable. */ public BaseDrawable (Drawable drawable) { if (drawable instanceof BaseDrawable) name = ((BaseDrawable)drawable).getName(); leftWidth = drawable.getLeftWidth(); rightWidth = drawable.getRightWidth(); topHeight = drawable.getTopHeight(); bottomHeight = drawable.getBottomHeight(); minWidth = drawable.getMinWidth(); minHeight = drawable.getMinHeight(); }
/** Creates a new empty drawable with the same sizing information as the specified drawable. */ public BaseDrawable (Drawable drawable) { if (drawable instanceof BaseDrawable) name = ((BaseDrawable)drawable).getName(); leftWidth = drawable.getLeftWidth(); rightWidth = drawable.getRightWidth(); topHeight = drawable.getTopHeight(); bottomHeight = drawable.getBottomHeight(); minWidth = drawable.getMinWidth(); minHeight = drawable.getMinHeight(); }
/** Sets the background drawable and, if adjustPadding is true, sets the container's padding to * {@link Drawable#getBottomHeight()} , {@link Drawable#getTopHeight()}, {@link Drawable#getLeftWidth()}, and * {@link Drawable#getRightWidth()}. * @param background If null, the background will be cleared and padding removed. */ public void setBackground (Drawable background, boolean adjustPadding) { if (this.background == background) return; this.background = background; if (adjustPadding) { if (background == null) pad(Value.zero); else pad(background.getTopHeight(), background.getLeftWidth(), background.getBottomHeight(), background.getRightWidth()); invalidate(); } }
/** Sets the background drawable and, if adjustPadding is true, sets the container's padding to * {@link Drawable#getBottomHeight()} , {@link Drawable#getTopHeight()}, {@link Drawable#getLeftWidth()}, and * {@link Drawable#getRightWidth()}. * @param background If null, the background will be cleared and padding removed. */ public void setBackground (Drawable background, boolean adjustPadding) { if (this.background == background) return; this.background = background; if (adjustPadding) { if (background == null) pad(Value.zero); else pad(background.getTopHeight(), background.getLeftWidth(), background.getBottomHeight(), background.getRightWidth()); invalidate(); } }