本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Window.pack()
方法的一些代码示例,展示了Window.pack()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.pack()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Window
类名称:Window
方法名:pack
暂无
代码示例来源:origin: libgdx/libgdx
@Override
public void create () {
spriteBatch = new SpriteBatch();
// font = new BitmapFont(Gdx.files.internal("data/verdana39.fnt"), false);
font = new BitmapFont(Gdx.files.internal("data/arial-32-pad.fnt"), false);
// font = new FreeTypeFontGenerator(Gdx.files.internal("data/arial.ttf")).generateFont(new FreeTypeFontParameter());
font.getData().markupEnabled = true;
font.getData().breakChars = new char[] {'-'};
multiPageFont = new BitmapFont(Gdx.files.internal("data/multipagefont.fnt"));
// Add user defined color
Colors.put("PERU", Color.valueOf("CD853F"));
renderer = new ShapeRenderer();
renderer.setProjectionMatrix(spriteBatch.getProjectionMatrix());
stage = new Stage(new ScreenViewport());
Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
BitmapFont labelFont = skin.get("default-font", BitmapFont.class);
labelFont.getData().markupEnabled = true;
// Notice that the last [] has been deliberately added to test the effect of excessive pop operations.
// They are silently ignored, as expected.
label = new Label("<<[BLUE]M[RED]u[YELLOW]l[GREEN]t[OLIVE]ic[]o[]l[]o[]r[]*[MAROON]Label[][] [Unknown Color]>>", skin);
label.setPosition(100, 200);
stage.addActor(label);
Window window = new Window("[RED]Multicolor[GREEN] Title", skin);
window.setPosition(400, 300);
window.pack();
stage.addActor(window);
layout = new GlyphLayout();
}
代码示例来源:origin: libgdx/libgdx
window.row();
window.add(lbl).width(400);
window.pack();
window.pack();
stage.addActor(window);
代码示例来源:origin: langurmonkey/gaiasky
@Override
public void pack() {
collapsed = false;
super.pack();
}
代码示例来源:origin: libgdx/libgdx
window.row();
window.add(fpsLabel).colspan(4);
window.pack();
代码示例来源:origin: narfman0/GDXWorld
window.add(controlTable);
window.row();
window.pack();
window.setX(Gdx.graphics.getWidth()/2 - window.getWidth()/2);
window.setY(Gdx.graphics.getHeight()/2 - window.getHeight()/2);
代码示例来源:origin: narfman0/GDXWorld
window.row();
window.add(exitButton).colspan(2);
window.pack();
window.setX(Gdx.graphics.getWidth()/2 - window.getWidth()/2);
window.setY(Gdx.graphics.getHeight()/2 - window.getHeight()/2);
代码示例来源:origin: dsaltares/libgdx-cookbook
window.row().colspan(1);
window.add(thirdButton);
window.pack();
内容来源于网络,如有侵权,请联系作者删除!