本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.setWidget方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollPane.setWidget方法的具体用法?Java ScrollPane.setWidget怎么用?Java ScrollPane.setWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
的用法示例。
在下文中一共展示了ScrollPane.setWidget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: groupChildrenParse
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
@Override
public Group groupChildrenParse(CocoStudioUIEditor editor,
ObjectData widget, Group parent, Actor actor) {
ScrollPane scrollPane = (ScrollPane) actor;
Table table = new Table();
for (ObjectData childrenWidget : widget.getChildren()) {
Actor childrenActor = editor.parseWidget(table, childrenWidget);
if (childrenActor == null) {
continue;
}
table.setSize(Math.max(table.getWidth(), childrenActor.getRight()),
Math.max(table.getHeight(), childrenActor.getTop()));
table.addActor(childrenActor);
}
sort(widget, table);
//
scrollPane.setWidget(table);
return scrollPane;
}
示例2: setChild
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
/** @param child will be set as the managed child. */
protected void setChild(final Actor child) {
final ScrollPane scrollPane = getScrollPane();
if (scrollPane.getWidget() != null) {
getParser().throwErrorIfStrict("Scroll pane can have only one child. Received another child: " + child);
}
scrollPane.setWidget(child);
}
示例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;
}