本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}