本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.setForceScroll方法的典型用法代碼示例。如果您正苦於以下問題:Java ScrollPane.setForceScroll方法的具體用法?Java ScrollPane.setForceScroll怎麽用?Java ScrollPane.setForceScroll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
的用法示例。
在下文中一共展示了ScrollPane.setForceScroll方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: QuestUI
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //導入方法依賴的package包/類
public QuestUI() {
super("任務列表", Assets.instance.STATUSUI_SKIN);
json = new Json();
quests = new Array<QuestGraph>();
closeButton = new TextButton("X", Assets.instance.STATUSUI_SKIN);
//create
questLabel = new Label("任務:", Assets.instance.STATUSUI_SKIN);
tasksLabel = new Label("步驟:", Assets.instance.STATUSUI_SKIN);
listQuests = new List<QuestGraph>(Assets.instance.STATUSUI_SKIN);
ScrollPane scrollPane = new ScrollPane (listQuests);
scrollPane.setOverscroll(false, false);
scrollPane.setFadeScrollBars(false);
scrollPane.setForceScroll(true, false);
listTasks = new List<QuestTask>(Assets.instance.STATUSUI_SKIN);
ScrollPane scrollPaneTasks = new ScrollPane (listTasks);
scrollPaneTasks.setOverscroll(false, false);
scrollPaneTasks.setFadeScrollBars(false);
scrollPaneTasks.setForceScroll(true, false);
//layout
this.add (questLabel).align(Align.left);
this.add (tasksLabel).align(Align.left);
this.add(closeButton).align(Align.right);
this.row();
this.defaults().expand().fill();
this.add(scrollPane).padRight(15);
this.add(scrollPaneTasks).padLeft(5).colspan(2);
//this.debug();
this.pack();
//Listeners
listQuests.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
QuestGraph quest = (QuestGraph) listQuests.getSelected();
if (quest == null) return;
populateQuestTaskDialog(quest);
}
}
);
}
示例2: DialogUI
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //導入方法依賴的package包/類
public DialogUI(HUDScreen parent) {
super("對話", Assets.instance.STATUSUI_SKIN, "solidbackground");
hudScreen = parent;
json = new Json();
graph = new ConversationGraph();
//create
talkText = new Label("", Assets.instance.STATUSUI_SKIN);
talkText.setWrap(true);
talkText.setAlignment(Align.left);
items = new List<ConversationChoice>(Assets.instance.STATUSUI_SKIN);
closeButton = new TextButton("X", Assets.instance.STATUSUI_SKIN);
ScrollPane scrollPane = new ScrollPane(items);
scrollPane.setOverscroll(false, false);
scrollPane.setFadeScrollBars(false);
scrollPane.setScrollingDisabled(true, false);
scrollPane.setForceScroll(true, false);
scrollPane.setScrollBarPositions(false, true);
//layout
this.add();
this.add(closeButton);
this.row();
this.defaults().expand().fill();
this.add(talkText).pad(10, 10, 10, 10);
this.row();
this.add(scrollPane).pad(10,10,10,10);
//this.debug();
this.pack();
//Listeners
items.addListener(new ClickListener() {
@Override
public void clicked (InputEvent event, float x, float y) {
ConversationChoice choice = (ConversationChoice)items.getSelected();
if( choice == null ) return;
//TODO: pickup,sleep event etc
// graph.notify(graph, choice.getConversationCommandEvent());
hudScreen.executeCommandEvent(graph, choice.getConversationCommandEvent());
populateConversationDialog(choice.getDestinationId());
}
});
}
示例3: parse
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //導入方法依賴的package包/類
@Override
public Actor parse(CocoStudioUIEditor editor, ObjectData widget) {
ScrollPaneStyle style = new ScrollPaneStyle();
if (widget.getFileData() != null) {
style.background = editor
.findDrawable(widget, widget.getFileData());
}
ScrollPane scrollPane = new ScrollPane(null, style);
if ("Vertical_Horizontal".equals(widget.getScrollDirectionType())) {
scrollPane.setForceScroll(true, true);
} else if ("Horizontal".equals(widget.getScrollDirectionType())) {
scrollPane.setForceScroll(true, false);
} else if ("Vertical".equals(widget.getScrollDirectionType())) {
scrollPane.setForceScroll(false, true);
}
scrollPane.setClamp(widget.isClipAble());
scrollPane.setFlickScroll(widget.isIsBounceEnabled());
Table table = new Table();
table.setSize(widget.getInnerNodeSize().getWidth(), widget
.getInnerNodeSize().getHeight());
if (widget.getComboBoxIndex() == 0) {// 無顏色
} else if (widget.getComboBoxIndex() == 1) {// 單色
Pixmap pixmap = new Pixmap((int) table.getWidth(),
(int) table.getHeight(), Format.RGBA8888);
Color color = editor.getColor(widget.getSingleColor(),
widget.getBackColorAlpha());
pixmap.setColor(color);
pixmap.fill();
Drawable drawable = new TextureRegionDrawable(new TextureRegion(
new Texture(pixmap)));
table.setBackground(drawable);
pixmap.dispose();
}
scrollPane.setWidget(table);
return scrollPane;
}
示例4: process
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //導入方法依賴的package包/類
@Override
public void process(final LmlParser parser, final LmlTag tag, final ScrollPane actor,
final String rawAttributeData) {
final boolean force = parser.parseBoolean(rawAttributeData, actor);
actor.setForceScroll(force, force);
}
示例5: process
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //導入方法依賴的package包/類
@Override
public void process(final LmlParser parser, final LmlTag tag, final ScrollPane actor,
final String rawAttributeData) {
actor.setForceScroll(actor.isForceScrollX(), parser.parseBoolean(rawAttributeData, actor));
}
示例6: process
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //導入方法依賴的package包/類
@Override
public void process(final LmlParser parser, final LmlTag tag, final ScrollPane actor,
final String rawAttributeData) {
actor.setForceScroll(parser.parseBoolean(rawAttributeData, actor), actor.isForceScrollY());
}