validation added to scrolling text

This commit is contained in:
Harrison Deng 2018-09-07 11:17:35 -05:00
parent 84b6a69dff
commit c1be4043d2

View File

@ -153,6 +153,8 @@ public class ScrollingText extends Widget {
@Override
public void draw(Batch batch, float parentAlpha) {
validate();
if (background != null) {
background.draw(batch, getX(), getY(), getWidth(), getHeight());
}
@ -162,14 +164,14 @@ public class ScrollingText extends Widget {
clipBounds.setX(coords.x+1);
clipBounds.setY(coords.y - 0.5f*getHeight());
batch.flush();
getStage().calculateScissors(clipBounds, scissors);
batch.flush();
if (ScissorStack.pushScissors(scissors)) {
font.draw(batch, text1, coords.x + text1Offset, coords.y + getFontHeight() + 4);
font.draw(batch, text2, coords.x + text2Offset, coords.y + getFontHeight() + 4);
batch.flush();
ScissorStack.popScissors();
};
}
}
@Override