Example usage for com.badlogic.gdx.scenes.scene2d.ui ScrollPane setScrollPercentY

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui ScrollPane setScrollPercentY

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui ScrollPane setScrollPercentY.

Prototype

public void setScrollPercentY(float percentY) 

Source Link

Usage

From source file:com.kotcrab.vis.ui.widget.ScrollableTextArea.java

License:Apache License

private void updateScrollPosition() {
    if (cullingArea == null || getParent() instanceof ScrollPane == false)
        return;//  w ww. j  a v a 2s .  c  o  m
    ScrollPane scrollPane = (ScrollPane) getParent();

    if (cullingArea.contains(getCursorX(), cullingArea.y) == false) {
        scrollPane.setScrollPercentX(getCursorX() / getWidth());
    }

    if (cullingArea.contains(cullingArea.x, (getHeight() - getCursorY())) == false) {
        scrollPane.setScrollPercentY(getCursorY() / getHeight());
    }
}