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


Java Stage.setDebugAll方法代碼示例

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


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

示例1: show

import com.badlogic.gdx.scenes.scene2d.Stage; //導入方法依賴的package包/類
@Override
public void show () {
    //orthographicCamera = new OrthographicCamera(3840, 2160);
    matrix4 = new Matrix4();
    spriteBatch = new SpriteBatch();
    viewport = new FitViewport(2560, 1440, new OrthographicCamera());
    viewport.apply();
    stage = new Stage(viewport);
    camera = createCamera();
    multiplexer = new InputMultiplexer();
    multiplexer.addProcessor(stage);
    Gdx.input.setInputProcessor(multiplexer);
    if(TDGalaxy.preferences.isDebug())
        stage.setDebugAll(true);
}
 
開發者ID:justinmarentette11,項目名稱:Tower-Defense-Galaxy,代碼行數:16,代碼來源:TDScreen.java

示例2: create

import com.badlogic.gdx.scenes.scene2d.Stage; //導入方法依賴的package包/類
@Override
public void create() {
	game_prefs = Gdx.app.getPreferences(prefs_name);

	game_stage = new Stage(view);
	game_states = new ObjectMap<String, GameState>();
	game_stage.setDebugAll(false);

	current_gamestates = new Array<GameState>();
	transition_state = new GameState(null);
	transition_state.setGame(this);

	assets = new AssetManager();
	assets.setLoader(TiledMap.class, new KyperMapLoader(assets.getFileHandleResolver()));
	assets.setLoader(ParticleEffect.class, new ParticleEffectLoader(assets.getFileHandleResolver()));
	assets.setLoader(ShaderProgram.class,
			new ShaderProgramLoader(assets.getFileHandleResolver(), VERTEX_SUFFIX, FRAGMENT_SUFFIX));
	sound = new SoundManager(this);

	packages = new Array<String>();
	packages.add("com.kyperbox.objects");

	global_data = new UserData(GAME_DATA_NAME);
	input = new GameInput();

	Gdx.input.setInputProcessor(game_stage);

	initiate();
}
 
開發者ID:kyperbelt,項目名稱:KyperBox,代碼行數:30,代碼來源:KyperBoxGame.java

示例3: onEnter

import com.badlogic.gdx.scenes.scene2d.Stage; //導入方法依賴的package包/類
@Override
	public void onEnter(IScene scene, Object config) {
		CCLog.engine(ModuleId, "onEnter");
		
		GdxUIConfig _config = (GdxUIConfig) config;
		if(_config == null) {
			//默認采用從director獲取的設置
			_config = GdxUIConfig.instance();
			_config.uiDefaultWidth = Director.getInstance().getVisibleSize().width;
			_config.uiDefaultHeight = Director.getInstance().getVisibleSize().height;
		}
		
		_stage = new Stage();
//		_stage.s
		
		//default存在就添加
		if(_defaultGroup != null) {
			if(_defaultGroup.getStage() != _stage) {
				_stage.addActor(_defaultGroup);
			}
		}
		
		_manager = new GdxUIManager(this);
		
		//應用配置
		_stage.getCamera().viewportWidth = _config.uiDefaultWidth;
		_stage.getCamera().viewportHeight = _config.uiDefaultHeight;
		_stage.getCamera().position.set(
				_stage.getCamera().viewportWidth/2f, 
				_stage.getCamera().viewportHeight/2f, 0);
		
		_stage.getViewport().setWorldWidth(_config.uiDefaultWidth);
		_stage.getViewport().setWorldHeight(_config.uiDefaultHeight);
		
		BaseInput.instance().addInputProcessor(_stage);
		Scheduler _scheduler = Director.getInstance().getScheduler();
		//visit 渲染完再處理這個
		renderFuncHandler = _scheduler.renderAfterSchedulePerFrame(renderFunc, 0, false);
		
		_stage.setDebugAll(false);
	}
 
開發者ID:mingwuyun,項目名稱:cocos2d-java,代碼行數:42,代碼來源:ModuleGdxUI.java

示例4: PlayScreenHud

import com.badlogic.gdx.scenes.scene2d.Stage; //導入方法依賴的package包/類
/**
 * Sets up all widgets and defines the layout of the HUD
 * @param playScreen the play screen
 */
public PlayScreenHud(PlayScreen playScreen) {
    this.playScreen = playScreen;

    viewport = new FitViewport(MainGameClass.WIDTH, MainGameClass.HEIGHT, new OrthographicCamera());
    stage = new Stage(viewport, playScreen.getGame().batch);
    stage.setDebugAll(MainGameClass.DEBUG);

    skin = new Skin(Gdx.files.internal("skins/hud/hud.json"));

    Table layoutTable = new Table();
    layoutTable.top();
    layoutTable.setFillParent(true);
    layoutTable.pad(getPixelSizeFromDensityIndependentPixels(50));

    timerLabel = new Label(String.format("%04d", playScreen.getGameProgress().getCurrentTime()), skin, "default");
    timerLabel.setStyle(changeLabelStyleFont(timerLabel.getStyle(), "fonts/PressStart2P.ttf", 64));

    healthBar = new ProgressBar(
            0f,
            playScreen.getGameProgress().getPlayerMaxHealth(),
            1f,
            false,
            skin,
            "default-horizontal"
    );

    lifesImageTextButton = new ImageTextButton(String.valueOf(playScreen.getGameProgress().getPlayerLifes()), skin, "lifes");
    lifesImageTextButton.setStyle(changeImageTextButtonStyle(lifesImageTextButton.getStyle(), "fonts/PressStart2P.ttf", 48));

    weaponStrengthImageTextButton = new ImageTextButton(String.valueOf(playScreen.getGameProgress().getPlayerWeaponList().get(playScreen.getGameProgress().getCurrentlyEquippedWeapon()).getStrength()), skin, "weapon_strength");
    weaponStrengthImageTextButton.setStyle(changeImageTextButtonStyle(weaponStrengthImageTextButton.getStyle(), "fonts/PressStart2P.ttf", 48));

    twitchImageTextButton = new ImageTextButton(String.format("%01d", 0), skin, "twitch");
    twitchImageTextButton.setStyle(changeImageTextButtonStyle(twitchImageTextButton.getStyle(), "fonts/PressStart2P.ttf", 48));

    layoutTable.add(healthBar).expandX().growX().left().top().spaceBottom(25);
    layoutTable.add(new Actor()).expandX().fillX().center().top().spaceBottom(25);
    layoutTable.add(timerLabel).expandX().right().top().spaceBottom(25);
    layoutTable.row();
    layoutTable.add(lifesImageTextButton).expandX().left().top().spaceBottom(10);
    layoutTable.row();
    layoutTable.add(weaponStrengthImageTextButton).expandX().left().top().spaceBottom(10);
    layoutTable.row();
    layoutTable.add(twitchImageTextButton).expandX().left().top().spaceBottom(10);

    stage.addActor(layoutTable);
}
 
開發者ID:johannesmols,項目名稱:GangsterSquirrel,代碼行數:52,代碼來源:PlayScreenHud.java


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