本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.setScrollPercentY方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollPane.setScrollPercentY方法的具体用法?Java ScrollPane.setScrollPercentY怎么用?Java ScrollPane.setScrollPercentY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
的用法示例。
在下文中一共展示了ScrollPane.setScrollPercentY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Addtogroup
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
public void Addtogroup(){
grchatfaction = new VerticalGroup();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH:mm:ss");
try {
grchatfaction.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.BLUE,"Welcome Chat!"));
grchatfaction.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.BLUE,"Faction!"));
grchatfaction.addActor(labelTest1);
} catch (ParseException e) {
e.printStackTrace();
Gdx.app.log("eroare","intra");
}
sp = new ScrollPane(grchatfaction);
sp.layout();
sp.setScrollingDisabled(true, false);
sp.setFillParent(true);sp.setLayoutEnabled(true);
ta = new Table();
ta.setFillParent(false);
ta.add(sp).fill().expand();
ta.setBounds(WIDTH *0.05f,background1.getY(), WIDTH*0.9f,background1.getHeight() * 1.05f);
ta.setVisible(false);
groupbotttom.addActor(ta);
sp.setScrollPercentY(200);
sp.act(Gdx.graphics.getDeltaTime());
sp.updateVisualScroll();
}
示例2: addchatlocation
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
public void addchatlocation(){
grchatlocation = new VerticalGroup();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH:mm:ss");
try {
grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.RED,"Welcome Chat!"));
grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.GREEN,"Location!"));
grchatlocation.addActor(labelTest);
} catch (ParseException e) {
e.printStackTrace();
Gdx.app.log("eroare","intra");
}
scrollchatpublic = new ScrollPane(grchatlocation);
scrollchatpublic.layout();
scrollchatpublic.setScrollingDisabled(true, false);
scrollchatpublic.setFillParent(true);
scrollchatpublic.setLayoutEnabled(true);
tablechatpublic = new Table();
tablechatpublic.setFillParent(false);
tablechatpublic.add(scrollchatpublic).fill().expand();
tablechatpublic.setBounds(WIDTH *0.05f,background1.getY(), WIDTH*0.9f,background1.getHeight() * 1.05f);
groupbotttom.addActor(tablechatpublic);
scrollchatpublic.setScrollPercentY(100);
scrollchatpublic.act(Gdx.graphics.getDeltaTime());
scrollchatpublic.updateVisualScroll();
}
示例3: updateScrollPosition
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
private void updateScrollPosition () {
if (cullingArea == null || getParent() instanceof ScrollPane == false) return;
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());
}
}