本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}