@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 setCursorPosition (float x, float y) { moveOffset = -1; Drawable background = style.background; BitmapFont font = style.font; float height = getHeight(); if (background != null) { height -= background.getTopHeight(); x -= background.getLeftWidth(); } x = Math.max(0, x); if (background != null) { y -= background.getTopHeight(); } cursorLine = (int) Math.floor((height - y) / font.getLineHeight()) + firstLineShowing; cursorLine = Math.max(0, Math.min(cursorLine, getLines() - 1)); super.setCursorPosition(x, y); updateCurrentLine(); }