當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。