当前位置: 首页>>代码示例>>Java>>正文


Java Skin.getFont方法代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Skin.getFont方法的典型用法代码示例。如果您正苦于以下问题:Java Skin.getFont方法的具体用法?Java Skin.getFont怎么用?Java Skin.getFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.scenes.scene2d.ui.Skin的用法示例。


在下文中一共展示了Skin.getFont方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createToolTip

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
private void createToolTip()
{
	Skin skin = new Skin();
	Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
	pixmap.setColor(Color.WHITE);
	pixmap.fill();
	skin.add("white", new Texture(pixmap));
	skin.add("default", new BitmapFont());

	TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
	textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
	textButtonStyle.font = skin.getFont("default");
	skin.add("default", textButtonStyle);

	labelToolTip = new TextButton("TEST", skin);
	labelToolTip.setX(5);
	labelToolTip.setY(5);
	labelToolTip.setWidth(125);
	labelToolTip.setVisible(false);
	labelToolTip.getLabel().setWrap(true);
	labelToolTip.setHeight(labelToolTip.getLabel().getHeight());
	group.addActor(labelToolTip);
}
 
开发者ID:MartensCedric,项目名称:LD38-Compo,代码行数:24,代码来源:LudumDare38.java

示例2: createResetButton

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
private void createResetButton()
{
	Skin skin = new Skin();
	Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
	pixmap.setColor(Color.WHITE);
	pixmap.fill();
	skin.add("white", new Texture(pixmap));
	skin.add("default", new BitmapFont());

	TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
	textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
	textButtonStyle.font = skin.getFont("default");
	skin.add("default", textButtonStyle);

	btnReset = new TextButton("RESET", skin);
	btnReset.setX(5);
	btnReset.setY(Gdx.graphics.getHeight() - 25);
	btnReset.setWidth(60);
	btnReset.setVisible(true);
	group.addActor(btnReset);
}
 
开发者ID:MartensCedric,项目名称:LD38-Compo,代码行数:22,代码来源:LudumDare38.java

示例3: createUndoButton

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
private void createUndoButton()
{
	Skin skin = new Skin();
	Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
	pixmap.setColor(Color.WHITE);
	pixmap.fill();
	skin.add("white", new Texture(pixmap));
	skin.add("default", new BitmapFont());

	TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
	textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
	textButtonStyle.font = skin.getFont("default");
	skin.add("default", textButtonStyle);

	btnUndo = new TextButton("UNDO", skin);
	btnUndo.setX(70);
	btnUndo.setY(Gdx.graphics.getHeight() - 25);
	btnUndo.setWidth(60);
	btnUndo.setVisible(true);
	group.addActor(btnUndo);
}
 
开发者ID:MartensCedric,项目名称:LD38-Compo,代码行数:22,代码来源:LudumDare38.java

示例4: IntroScreen

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
IntroScreen(final ParticleGame game) {
    particle_game = game;
    stage = new Stage();
    table = new Table();

    table.setFillParent(true);
    table.setDebug(true);
    stage.addActor(table);

    Skin skin = new Skin();
    
    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    
    skin.add("white", new Texture(pixmap));
    skin.add("font", game.getFont());

    TextButton.TextButtonStyle text_button_style = new TextButton.TextButtonStyle();
    final Color button_color = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
    final Color hover_color = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
    text_button_style.up = skin.newDrawable("white", button_color);
    text_button_style.down = skin.newDrawable("white", button_color);
    text_button_style.over = skin.newDrawable("white", hover_color);
    text_button_style.font = skin.getFont("font");
    skin.add("default", text_button_style);

    TextButton play_button = new TextButton("play", skin);
    play_button.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            particle_game.setScreen(particle_game.getGameSetupScreen());
        }
    });
    table.add(play_button);
}
 
开发者ID:treeman1111,项目名称:Particles,代码行数:37,代码来源:IntroScreen.java

示例5: ParticleChoiceScreen

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
ParticleChoiceScreen(final ParticleGame p, final GameScreen g) {
    game = p;
    game_screen = g;

    camera = new OrthographicCamera(PARTICLE_BOARD_W, PARTICLE_BOARD_W);
    camera.position.set(PARTICLE_BOARD_W / 2, PARTICLE_BOARD_W / 2, 0);
    camera.update();

    initStage();
    initTable();

    Skin skin = new Skin();

    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", game.getFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    final Color buttonColor = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
    final Color hoverColor = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
    textButtonStyle.up = skin.newDrawable("white", buttonColor);
    textButtonStyle.down = skin.newDrawable("white", buttonColor);
    textButtonStyle.over = skin.newDrawable("white", hoverColor);
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = game.getFont();
    labelStyle.fontColor = Color.WHITE;
    skin.add("default", labelStyle);

    // initTableContents(skin);
}
 
开发者ID:treeman1111,项目名称:Particles,代码行数:36,代码来源:ParticleChoiceScreen.java

示例6: GameSetupScreen

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
GameSetupScreen(ParticleGame game) {
    particle_game = game;
    stage = new Stage();
    table = new Table();

    table.setDebug(true);
    table.setFillParent(true);
    stage.addActor(table);

    Skin skin = new Skin();

    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();

    skin.add("white", new Texture(pixmap));
    skin.add("font", game.getFont());

    TextButton.TextButtonStyle text_button_style = new TextButton.TextButtonStyle();
    final Color button_color = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
    final Color hover_color = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
    text_button_style.up = skin.newDrawable("white", button_color);
    text_button_style.down = skin.newDrawable("white", button_color);
    text_button_style.over = skin.newDrawable("white", hover_color);
    text_button_style.font = skin.getFont("font");
    skin.add("default", text_button_style);

    TextButton create_game_button = new TextButton("create game!", skin);
    create_game_button.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            final int num_boards = 10;
            final PlayerCamera player_camera = new PlayerCamera(PARTICLE_BOARD_W, PARTICLE_BOARD_W,
                PARTICLE_BOARD_W * num_boards
            );
            final DisplayManager display_manager = new DisplayManager(particle_game.getBatch(), player_camera);
            final PropertyDictionary property_dictionary = new PropertyDictionary(10, 10, 10, 10);
            final ParticleSystem particle_system = new ParticleSystem(PARTICLE_BOARD_W, num_boards);
            final VelocitySystem velocity_system = new VelocitySystem(PARTICLE_BOARD_W / 9);
            final WorldGenerator world_generator = new WorldGenerator(
                    11, 25, PARTICLE_BOARD_W * num_boards
            );

            particle_game.setCamera(player_camera);
            particle_game.setDisplayManager(display_manager);
            particle_game.setPropertyDictionary(property_dictionary);
            particle_game.setParticleSystem(particle_system);
            particle_game.setVelocitySystem(velocity_system);

            world_generator.generate(property_dictionary, particle_system);
            final Player player = new Player(particle_game, 0, 50);
            particle_game.setPlayer(player);

            particle_game.setScreen(particle_game.getGameScreen());
        }
    });
    table.add(create_game_button);
}
 
开发者ID:treeman1111,项目名称:Particles,代码行数:59,代码来源:GameSetupScreen.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.Skin.getFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。