當前位置: 首頁>>代碼示例>>Java>>正文


Java ScrollPane類代碼示例

本文整理匯總了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();
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:26,代碼來源:ScreenChat.java

示例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();
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:25,代碼來源:ScrollInventoryActor.java

示例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();
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:26,代碼來源:ScreenChat.java

示例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();
}
 
開發者ID:raeleus,項目名稱:bobbybird,代碼行數:17,代碼來源:ScrollerPane.java

示例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();
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:25,代碼來源:ScrollInventoryActor.java

示例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);
}
 
開發者ID:MartensCedric,項目名稱:Hexpert,代碼行數:17,代碼來源:TutorialDialog.java

示例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);
	
}
 
開發者ID:Radomiej,項目名稱:JavityEngine,代碼行數:22,代碼來源:JXmlUi.java

示例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);		
	}
 
開發者ID:Radomiej,項目名稱:JavityEngine,代碼行數:21,代碼來源:JXmlUi.java

示例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);
}
 
開發者ID:Radomiej,項目名稱:JavityEngine,代碼行數:21,代碼來源:JXmlUi.java

示例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);
}
 
開發者ID:Radomiej,項目名稱:JavityEngine,代碼行數:26,代碼來源:JXmlUi.java

示例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();
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:17,代碼來源:RootTable.java

示例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;
}
 
開發者ID:overengineering,項目名稱:space-travels-3,代碼行數:21,代碼來源:DebugScreen.java

示例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();


}
 
開發者ID:Longri,項目名稱:cachebox3.0,代碼行數:25,代碼來源:MainScreen.java

示例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);
}
 
開發者ID:Longri,項目名稱:cachebox3.0,代碼行數:17,代碼來源:EditTextBox.java

示例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();
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:21,代碼來源:GameObjectViewer.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.ScrollPane類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。