當前位置: 首頁>>代碼示例>>Java>>正文


Java Table.debug方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.debug方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.debug方法的具體用法?Java Table.debug怎麽用?Java Table.debug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.scenes.scene2d.ui.Table的用法示例。


在下文中一共展示了Table.debug方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initGuiInGame

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void initGuiInGame() {
    mGuiStage = new Stage(new ScreenViewport());

    Table gameScore = new Table();
    if (DEBUG_RENDERER) {
        gameScore.debug();
    }

    float scorePanelWidth = Gdx.graphics.getWidth() * 0.8f; // 80 % of screen
    float scorePanelHeight = Gdx.graphics.getHeight() * 0.2f; // 20 % of screen

    gameScore.setWidth(scorePanelWidth);
    gameScore.setHeight(scorePanelHeight);
    gameScore.setY(Gdx.graphics.getHeight() - (scorePanelHeight + 30.f));
    gameScore.setX((Gdx.graphics.getWidth() - scorePanelWidth) * 0.5f);

    gameScore.setBackground(new NinePatchDrawable(
            new NinePatch(new Texture(Gdx.files.internal("red_button13.png")), 24, 24, 24, 24)));
    gameScore.pad(32.f);

    Label scoreLabel = new Label("Score", new Label.LabelStyle(
            mDefaultFont, COLOR_FONT));
    scoreLabel.setFontScale(1.2f);

    gameScore.add(scoreLabel).expand();

    gameScore.row();

    mScoreLabel = new Label("" + mPointTotal, new Label.LabelStyle(
            mDefaultFont, COLOR_FONT));
    mScoreLabel.setFontScale(2.0f);

    gameScore.add(mScoreLabel).expand();

    mGuiStage.addActor(gameScore);
}
 
開發者ID:tgobbens,項目名稱:fluffybalance,代碼行數:37,代碼來源:Balanceball.java

示例2: initGuiGameOver

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void initGuiGameOver() {
    mGuiGameOverStage = new Stage(new ScreenViewport());

    Table rootTable = new Table();
    if (DEBUG_RENDERER) {
        rootTable.debug();
    }

    // add margin on the bottom for iOS
    final float dialogBottomOffset = (Gdx.app.getType() == Application.ApplicationType.iOS) ? 220 : 0;

    final float dialogMargin = 50.f;
    final float dialogWidth = Gdx.graphics.getWidth() - (dialogMargin * 2.f);
    final float dialogHeight = Gdx.graphics.getHeight() - (dialogMargin * 2.f) - dialogBottomOffset;

    rootTable.setWidth(dialogWidth);
    rootTable.setHeight(dialogHeight);
    rootTable.setPosition(dialogMargin, dialogMargin + dialogBottomOffset);

    rootTable.background(
            new NinePatchDrawable(
                    new NinePatch(new Texture(Gdx.files.internal("blue_panel.png")), 24, 24, 24, 24)));

    Label label = new Label("GAME OVER", mSkin);
    label.setFontScale(2.f);
    label.setStyle(new Label.LabelStyle(mDefaultFont, COLOR_FONT));
    rootTable.add(label).expand().padTop(dialogHeight * 0.025f);

    rootTable.row();

    TextButton restartButton = new TextButton("RESTART", mSkin);
    restartButton.getLabel().setFontScale(1.f);
    restartButton.getLabel().setStyle(new Label.LabelStyle(mDefaultFont, COLOR_FONT));
    restartButton.addCaptureListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            onStartGame();
        }
    });

    Array<Integer> highScores = fetchHighScores();

    mHighScoreLabel = new Array<Label>();

    for (int i = 0; i < highScores.size; i++) {
        Label scoreLabel = new Label("high score: " + highScores.get(i), mSkin);
        scoreLabel.setFontScale(1.0f);
        scoreLabel.setStyle(new Label.LabelStyle(mDefaultFont, COLOR_FONT));
        rootTable.add(scoreLabel).expand();
        rootTable.row();

        mHighScoreLabel.add(scoreLabel);
    }

    // don't like the scene2d interface, if has bad defaults and documentation
    // try to correctly position the bottom restart button
    rootTable.add(restartButton).expand().width(
            dialogWidth - (dialogMargin * 4.f)).height(dialogHeight * 0.1f).bottom().padBottom(dialogHeight * 0.05f);

    mGuiGameOverStage.addActor(rootTable);
}
 
開發者ID:tgobbens,項目名稱:fluffybalance,代碼行數:62,代碼來源:Balanceball.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.Table.debug方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。