本文整理汇总了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());
}