当前位置: 首页>>代码示例>>Java>>正文


Java ScrollPane.setWidget方法代码示例

本文整理汇总了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;
}
 
开发者ID:varFamily,项目名称:cocos-ui-libgdx,代码行数:23,代码来源:CCScrollView.java

示例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);
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:9,代码来源:ScrollPaneLmlTag.java

示例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;
}
 
开发者ID:varFamily,项目名称:cocos-ui-libgdx,代码行数:51,代码来源:CCScrollView.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.setWidget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。