本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.ScrollPane类的典型用法代码示例。如果您正苦于以下问题:Java ScrollPane类的具体用法?Java ScrollPane怎么用?Java ScrollPane使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScrollPane类属于com.badlogic.gdx.scenes.scene2d.ui包,在下文中一共展示了ScrollPane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ScrollInventoryActor
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
public ScrollInventoryActor(Inventory inventory, int slots) {
defaults().space(4f);
add(new Label(inventory.getDisplayName(), new LabelStyle(Fonts.hud, Color.WHITE)));
row();
inner = new Table();
inner.defaults().space(4f);
for (int i = 0; i < inventory.itemStacks.length; i++) {
SlotActor slotActor = new SlotActor(inventory, i);
inner.add(slotActor);
if ((i + 1) % inventory.width == 0) {
inner.row();
}
}
inner.pack();
scrollPane = new ScrollPane(inner);
scrollPane.setScrollingDisabled(true, false);
add(scrollPane).height(slots * CALIBRATION_PER_ROW).fill();
row();
pack();
}
示例3: 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();
}
示例4: ScrollerPane
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
public ScrollerPane(TiledDrawable tiledDrawable, float xSpeed, float ySpeed) {
this.tiledDrawable = tiledDrawable;
this.xSpeed = xSpeed;
this.ySpeed = ySpeed;
xPosition = 0.0f;
yPosition = 0.0f;
Image image = new Image(tiledDrawable);
innerTable = new Table();
innerTable.add(image).width(5000);
scrollPane = new ScrollPane(innerTable);
scrollPane.setTouchable(Touchable.disabled);
scrollPane.setSmoothScrolling(false);
this.add(scrollPane).grow();
}
示例5: ScrollInventoryActor
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
public ScrollInventoryActor(Inventory inventory, int slots) {
defaults().space(4f);
add(new Label(inventory.getDisplayName(), new LabelStyle(Fonts.hud, Color.WHITE)));
row();
inner = new Table();
inner.defaults().space(4f);
for (int i = 0; i < inventory.itemStacks.length; i++) {
SlotActor slotActor = new SlotActor(inventory, i);
inner.add(slotActor);
if ((i + 1) % inventory.width == 0) {
inner.row();
}
}
inner.pack();
scrollPane = new ScrollPane(inner);
scrollPane.setScrollingDisabled(true, false);
add(scrollPane).height(slots * CALIBRATION_PER_ROW).fill();
row();
pack();
}
示例6: TutorialDialog
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
public TutorialDialog(Hexpert hexpert, Skin skin, boolean useScrollPane) {
super(hexpert, skin);
scrollContent = new Table();
if(useScrollPane) {
scrollPane = new ScrollPane(scrollContent, skin);
getContentTable().add(scrollPane);
}
getButtonTable().defaults().pad(15);
I18NBundle i18N = hexpert.i18NBundle;
TextButton textButtonOk = new TextButton(i18N.get("ok"), skin);
getButtonTable().add(textButtonOk);
setObject(textButtonOk, null);
}
示例7: addHorizontalGroup
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
private void addHorizontalGroup(Table table, Element element) {
Table horizontalGroup = new Table();
ScrollPane scrollPane = new ScrollPane(horizontalGroup, skin);
Cell<ScrollPane> cell = table.add(scrollPane);
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null) {
atrributes = new ObjectMap<String, String>();
}
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
horizontalGroup.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
addChildrens(element, horizontalGroup);
actorsMap.put(horizontalGroup.getName(), horizontalGroup);
}
示例8: addVerticalGroup
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
private void addVerticalGroup(Table table, Element element) {
VerticalGroup verticalGroup = new VerticalGroup();
ScrollPane scrollPane = new ScrollPane(verticalGroup, skin);
Cell<ScrollPane> cell = table.add(scrollPane);
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null) {
atrributes = new ObjectMap<String, String>();
}
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
verticalGroup.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
// addChildrens(element, horizontalGroup);
actorsMap.put(verticalGroup.getName(), verticalGroup);
}
示例9: addScrollPanel
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
private void addScrollPanel(Table table, Element element) {
Table tableScroll = new Table(skin);
ScrollPane scrollPane = new ScrollPane(tableScroll, skin);
Cell<ScrollPane> cell = table.add(scrollPane);
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null) {
atrributes = new ObjectMap<String, String>();
}
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
tableScroll.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
addChildrens(element, tableScroll);
actorsMap.put(tableScroll.getName(), tableScroll);
}
示例10: addList
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
private void addList(Table table, Element element) {
Gdx.app.log("JXmlUi", "addList");
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null)
atrributes = new ObjectMap<String, String>();
List<String> list = new List<String>(skin);
list.getSelection().setMultiple(false);
ScrollPane scrollPane = new ScrollPane(list, skin);
Cell<ScrollPane> cell = table.add(scrollPane);
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
list.setName(atrributes.get(key));
scrollPane.setName(atrributes.get(key) + "-scroll-panel");
}
}
cellPrepare(cell, atrributes);
actorsMap.put(list.getName(), list);
actorsMap.put(scrollPane.getName(), scrollPane);
addElementsInList(element, list);
}
示例11: addPreviewProperties
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
private void addPreviewProperties(Table bottom, InputListener scrollPaneListener) {
Label label = new Label("Preview Properties", getSkin(), "title");
bottom.add(label);
bottom.row();
previewPropertiesTable = new Table();
previewPropertiesTable.defaults().pad(5.0f);
ScrollPane scrollPane = new ScrollPane(previewPropertiesTable, getSkin());
scrollPane.setFadeScrollBars(false);
scrollPane.setFlickScroll(false);
scrollPane.addListener(scrollPaneListener);
bottom.add(scrollPane).grow().padTop(10.0f).padBottom(10.0f);
refreshPreviewProperties();
}
示例12: getButtonScrollPane
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
private ScrollPane getButtonScrollPane()
{
Table table = UIManager.getDefaultTable();
table.add(getDebugDrawTextButton());
table.row();
table.add(getNoGravityTextButton());
table.row();
table.add(getInfiniteFuelTextButton());
table.row();
table.add(getForceCrashButton());
table.row();
table.add(getErrorButton());
table.row();
table.add(getSignOutButton());
ScrollPane scrollPane = new ScrollPane(table);
return scrollPane;
}
示例13: MainScreen
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
public MainScreen(SkinEditorGame game) {
this.game = game;
barMenu = new MenuBar(game);
barWidgets = new WidgetsBar(game);
panePreview = new PreviewPane(game, this);
paneOptions = new OptionsPane(game, panePreview);
CB_SpriteBatch batch = new CB_SpriteBatch(CB_SpriteBatch.Mode.NORMAL);
stage = new Stage(new ScreenViewport(),batch);
Table table = new Table();
table.setFillParent(true);
table.top().left().add(barMenu).expandX().fillX().colspan(2).row();
table.top().left().add(barWidgets).expandX().fillX().colspan(2).row();
table.top().left().add(paneOptions).width(420).left().fill().expandY();
ScrollPane scrollPane = new ScrollPane(panePreview);
table.add(scrollPane).fill().expand();
stage.addActor(table);
barWidgets.initializeButtons();
}
示例14: setStyle
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
public void setStyle(EditTextStyle style) {
this.style = style;
ScrollPane.ScrollPaneStyle sps = new ScrollPane.ScrollPaneStyle();
sps.background = style.background;
this.scrollPane.setStyle(sps);
Label.LabelStyle ls = new Label.LabelStyle();
ls.font = style.font;
ls.fontColor = style.fontColor;
this.textLabel.setStyle(ls);
Button.ButtonStyle bs = new Button.ButtonStyle();
bs.up = style.editIcon;
bs.down = style.editIcon;
editButton.setStyle(bs);
}
示例15: GameObjectViewer
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入依赖的package包/类
public GameObjectViewer(GameObjectViewerStyle style) {
super(Strings.getString(UIManager.STRING_TABLE, "goViewer"), style);
goName = new Label("", style.headingStyle);
goId = new Label("", style.headingStyle);
goInternalId = new Label("", style.headingStyle);
goDetails = new Label("", style.detailsStyle);
goDetails.setWrap(true);
goDetails.setAlignment(Align.topLeft);
ScrollPane scrollPane = new ForcedScrollPane(goDetails, style.scrollPaneStyle);
Table headingTable = new Table();
headingTable.add(goName).fill();
headingTable.add(goId).fill();
headingTable.add(goInternalId).fill().expand();
add(headingTable).left().width(style.scrollPaneWidth);
row();
add(scrollPane).width(style.scrollPaneWidth).height(style.scrollPaneHeight).fill().colspan(3);
pack();
}