}
}
@Override
public void draw (SpriteBatch batch, float parentAlpha) {
final BitmapFont font = style.font;
final Color fontColor = style.fontColor;
final NinePatch background = style.background;
final TextureRegion selection = style.selection;
final NinePatch cursorPatch = style.cursor;
batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
background.draw(batch, x, y, width, height);
float textY = (int)(height / 2) + (int)(textBounds.height / 2) + font.getDescent() / 2;
font.setColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a * parentAlpha);
calculateOffsets();
if (hasSelection) {
batch.draw(selection, x + selectionX + background.getLeftWidth() + renderOffset,
y + textY - textBounds.height - font.getDescent() / 2, selectionWidth, textBounds.height);
}
font.draw(batch, text, x + background.getLeftWidth() + textOffset, y + textY, visibleTextStart, visibleTextEnd);
if (parent.keyboardFocusedActor == this) {
blink();
if (cursorOn) {
cursorPatch.draw(batch, x + background.getLeftWidth() + glyphPositions.get(cursor) + renderOffset - 1, y + textY
- textBounds.height - font.getDescent(), cursorPatch.getTotalWidth(), textBounds.height + font.getDescent() / 2);
}
}
}