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


Java ImageTextButtonStyle类代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle的典型用法代码示例。如果您正苦于以下问题:Java ImageTextButtonStyle类的具体用法?Java ImageTextButtonStyle怎么用?Java ImageTextButtonStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ImageTextButtonStyle类属于com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton包,在下文中一共展示了ImageTextButtonStyle类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addExit

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
private void addExit() {
	NinePatchDrawable draw = new NinePatchDrawable(Assets.hotkey.button);

	TextButtonStyle style = new ImageTextButtonStyle();
	style.up = draw;
	style.down = draw.tint(Color.DARK_GRAY);
	style.checked = draw;
	style.font = Assets.fonts.font;

	TextButton btn = new TextButton("Exit", style);
	btn.addListener(new ClickListener() {
		@Override
		public void clicked(InputEvent event, float x, float y) {
			super.clicked(event, x, y);
			Gdx.app.exit();
		}
	});
	table.add(btn);
	table.row();
}
 
开发者ID:libgdx-jam,项目名称:GDXJam,代码行数:21,代码来源:MainMenuScreen.java

示例2: add

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
public void add(String title, final AbstractScreen screen) {
	NinePatchDrawable draw = new NinePatchDrawable(Assets.hotkey.button);

	TextButtonStyle style = new ImageTextButtonStyle();
	style.up = draw;
	style.down = draw.tint(Color.DARK_GRAY);
	style.checked = draw;
	style.font = Assets.fonts.font;

	TextButton btn = new TextButton(title, style);
	btn.addListener(new ClickListener() {
		@Override
		public void clicked(InputEvent event, float x, float y) {
			super.clicked(event, x, y);
			GameManager.setScreen(screen);
		}
	});
	table.add(btn);
	table.row();

}
 
开发者ID:libgdx-jam,项目名称:GDXJam,代码行数:22,代码来源:MainMenuScreen.java

示例3: createButton

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
/**
 * Erzeugt den LadeButtonText.
 */
private void createButton() {
	Drawable drawable = new TextureRegionDrawable((new TextureRegion(new Texture(
			Gdx.files.internal("splashscreen/buttonBackground.png")))));
	FreeTypeFontGenerator gen = new FreeTypeFontGenerator(
			Gdx.files.internal("fonts/textfont/Grundschrift-Bold.ttf"));
	FreeTypeFontParameter frontPara = new FreeTypeFontParameter();
	frontPara.size = 40;

	BitmapFont b = gen.generateFont(frontPara);
	gen.dispose();
	ImageTextButtonStyle imageButtonStyle = new ImageTextButton.ImageTextButtonStyle();
	imageButtonStyle.down = drawable;
	imageButtonStyle.up = drawable;
	imageButtonStyle.font = b;

	imageButtonStyle.fontColor = Color.valueOf("877E6A");

	textContent = new ImageTextButton("Lade... : ", imageButtonStyle);

}
 
开发者ID:PhilippGrulich,项目名称:HAW-SE2-projecthorse,代码行数:24,代码来源:SplashScreen.java

示例4: init

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
public void init() {
    this.labelFont = new BitmapFont();

    this.buttonBgTex = new Texture(Gdx.files.internal("textures/gui/guiButtonBackground.png"));
    this.buttonBgPressTex = new Texture(Gdx.files.internal("textures/gui/guiButtonBackground-pressed.png"));
    this.buttonBgDisabledTex = new Texture(Gdx.files.internal("textures/gui/guiButtonBackground-disabled.png"));

    SpriteDrawable buttonBgSprite = new SpriteDrawable(new Sprite(buttonBgTex));
    SpriteDrawable buttonBgPressSprite = new SpriteDrawable(new Sprite(buttonBgPressTex));
    SpriteDrawable buttonBgDisabledSprite =new SpriteDrawable(new Sprite(buttonBgDisabledTex));
    this.buttonStyle = new ImageTextButtonStyle(buttonBgSprite, buttonBgPressSprite, buttonBgDisabledSprite, labelFont);
}
 
开发者ID:mstojcevich,项目名称:Radix,代码行数:13,代码来源:SceneTheme.java

示例5: process

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final ImageTextButton actor,
        final String rawAttributeData) {
    final ImageTextButtonStyle style = new ImageTextButtonStyle(actor.getStyle());
    style.imageUp = parser.getData().getDefaultSkin().getDrawable(parser.parseString(rawAttributeData, actor));
    actor.setStyle(style);
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:8,代码来源:TextButtonImageLmlAttribute.java

示例6: onFinishLoading

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
@Override
public void onFinishLoading() {
    Skin skin = getSkin(Assets.Skin.UI_SKIN);
    BitmapFont menuFont = getFont(game.deviceSettings.menuFont);
    BitmapFont screenTitle = getFont(game.deviceSettings.screenTitleFont);
    BitmapFont hudFont = getFont(game.deviceSettings.hudFont);
    BitmapFont rulesFont = getFont(game.deviceSettings.rulesFont);

    skin.get(Assets.Skin.SKIN_STYLE_MENU, TextButtonStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, TextButtonStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_DIALOG, TextButtonStyle.class).font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, ImageTextButtonStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, ImageTextButtonStyle.class).font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, SelectBoxStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_MENU, SelectBoxStyle.class).listStyle.font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, SelectBoxStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, SelectBoxStyle.class).listStyle.font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_DIALOG, WindowStyle.class).titleFont = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, LabelStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_SCREEN_TITLE, LabelStyle.class).font = screenTitle;

    skin.get(Assets.Skin.SKIN_STYLE_GAME, LabelStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_DIALOG, LabelStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_PLAYER_TAG, LabelStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_RULES, LabelStyle.class).font = rulesFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, TextFieldStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, TextFieldStyle.class).font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, CheckBoxStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, CheckBoxStyle.class).font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, ListStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, ListStyle.class).font = hudFont;
}
 
开发者ID:apotapov,项目名称:tafl,代码行数:40,代码来源:TaflGraphicsService.java

示例7: resetProperties

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
public void resetProperties() {
    properties.clear();
    
    if (clazz.equals(Button.class)) {
        newStyleProperties(ButtonStyle.class);
    } else if (clazz.equals(CheckBox.class)) {
        newStyleProperties(CheckBoxStyle.class);
        properties.get("checkboxOn").optional = false;
        properties.get("checkboxOff").optional = false;
        properties.get("font").optional = false;
    } else if (clazz.equals(ImageButton.class)) {
        newStyleProperties(ImageButtonStyle.class);
    } else if (clazz.equals(ImageTextButton.class)) {
        newStyleProperties(ImageTextButtonStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(Label.class)) {
        newStyleProperties(LabelStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(List.class)) {
        newStyleProperties(ListStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColorSelected").optional = false;
        properties.get("fontColorUnselected").optional = false;
        properties.get("selection").optional = false;
    } else if (clazz.equals(ProgressBar.class)) {
        newStyleProperties(ProgressBarStyle.class);
        
        //Though specified as optional in the doc, there are bugs without "background" being mandatory
        properties.get("background").optional = false;
    } else if (clazz.equals(ScrollPane.class)) {
        newStyleProperties(ScrollPaneStyle.class);
    } else if (clazz.equals(SelectBox.class)) {
        newStyleProperties(SelectBoxStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColor").optional = false;
        properties.get("scrollStyle").optional = false;
        properties.get("scrollStyle").value = "default";
        properties.get("listStyle").optional = false;
        properties.get("listStyle").value = "default";
    } else if (clazz.equals(Slider.class)) {
        newStyleProperties(SliderStyle.class);
        
        //Though specified as optional in the doc, there are bugs without "background" being mandatory
        properties.get("background").optional = false;
    } else if (clazz.equals(SplitPane.class)) {
        newStyleProperties(SplitPaneStyle.class);
        properties.get("handle").optional = false;
    } else if (clazz.equals(TextButton.class)) {
        newStyleProperties(TextButtonStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(TextField.class)) {
        newStyleProperties(TextFieldStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColor").optional = false;
    } else if (clazz.equals(TextTooltip.class)) {
        newStyleProperties(TextTooltipStyle.class);
        properties.get("label").optional = false;
        properties.get("label").value = "default";
    } else if (clazz.equals(Touchpad.class)) {
        newStyleProperties(TouchpadStyle.class);
    } else if (clazz.equals(Tree.class)) {
        newStyleProperties(TreeStyle.class);
        properties.get("plus").optional = false;
        properties.get("minus").optional = false;
    } else if (clazz.equals(Window.class)) {
        newStyleProperties(WindowStyle.class);
        properties.get("titleFont").optional = false;
    }
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:70,代码来源:StyleData.java

示例8: init

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
@Override
public void init() {
    stage = new Stage();

    // TODO memory manage

    background = new Texture(Gdx.files.internal("textures/block/obsidian.png"));
    background.setWrap(TextureWrap.Repeat, TextureWrap.Repeat);

    errorLabel = new Label(null, new LabelStyle(new BitmapFont(), Color.RED));

    TextFieldStyle fieldStyle = new TextFieldStyle();
    fieldStyle.font = new BitmapFont();
    fieldStyle.fontColor = Color.WHITE;
    TextField ipField = new TextField("IP:Port", fieldStyle);

    ImageTextButtonStyle btnStyle = RadixClient.getInstance().getSceneTheme().getButtonStyle();

    TextButton connectButton = new TextButton("Connect", btnStyle);
    connectButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            String[] ipPort = ipField.getText().split(":");

            if(ipPort.length != 2) {
                invalidIpSyntax();
                return;
            }

            try {
                RadixClient.getInstance().enterRemoteWorld(ipPort[0], Short.parseShort(ipPort[1]));
            } catch (NumberFormatException ex) {
                invalidPort();
            }
        }
    });

    Table table = new Table();
    table.setFillParent(true);
    table.add(ipField);
    table.row();
    table.add(errorLabel);
    table.row();
    table.add(connectButton);
    stage.addActor(table);
}
 
开发者ID:mstojcevich,项目名称:Radix,代码行数:47,代码来源:ServerConnectGUI.java

示例9: getButtonStyle

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
public ImageTextButtonStyle getButtonStyle() {
    return this.buttonStyle;
}
 
开发者ID:mstojcevich,项目名称:Radix,代码行数:4,代码来源:SceneTheme.java

示例10: getImageTextButtonStyle

import com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.ImageTextButtonStyle; //导入依赖的package包/类
public ImageTextButtonStyle getImageTextButtonStyle(String icon) {
	ImageTextButtonStyle style = new ImageTextButtonStyle(
			getImageTextButtonStyle());
	style.imageUp = skin.getDrawable(icon);
	return style;
}
 
开发者ID:suluke,项目名称:gdx.automation,代码行数:7,代码来源:StyleHelper.java


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