當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageButton.setName方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.ImageButton.setName方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageButton.setName方法的具體用法?Java ImageButton.setName怎麽用?Java ImageButton.setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.scenes.scene2d.ui.ImageButton的用法示例。


在下文中一共展示了ImageButton.setName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ItemBox

import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //導入方法依賴的package包/類
public ItemBox(ItemStack stack, int inventoryX, int inventoryY, String extra) {
	this.stack = stack;
	this.inventoryX = inventoryX;
	this.inventoryY = inventoryY;
	this.extra = extra;

	btnGroup = CachePool.getGroup();
	btnGroup.setBounds(0, 0, 60, 60);

	style = new ImageButton.ImageButtonStyle();
	style.up = inventoryBoxDrawable;
	btn = new ImageButton(style);
	btn.setBounds(0, 0, 60, 60);
	btn.setName(extra);
	btnGroup.addActor(btn);

	setupBox();
	add(btnGroup);
}
 
開發者ID:jmrapp1,項目名稱:TerraLegion,代碼行數:20,代碼來源:ItemBox.java

示例2: getActors

import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //導入方法依賴的package包/類
@Override
   public Actor[] getActors(Skin skin) {
ImageButton musicTooltip = new OwnImageButton(skin, "tooltip");
musicTooltip.addListener(new TextTooltip(
	I18n.bundle.format("gui.tooltip.music", SysUtilsFactory.getSysUtils().getDefaultMusicDir()), skin));

ImageButton reloadMusic = new OwnImageButton(skin, "reload");
reloadMusic.setName("reload music");
reloadMusic.addListener(new EventListener() {
    @Override
    public boolean handle(Event event) {
	if (event instanceof ChangeEvent) {
	    EventManager.instance.post(Events.MUSIC_RELOAD_CMD);
	    return true;
	}
	return false;
    }
});
reloadMusic.addListener(new TextTooltip(I18n.bundle.get("gui.music.reload"), skin));

return new Actor[] { musicTooltip, reloadMusic };
   }
 
開發者ID:langurmonkey,項目名稱:gaiasky,代碼行數:23,代碼來源:DesktopMusicActors.java

示例3: SiggdImageButton

import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //導入方法依賴的package包/類
public SiggdImageButton(String down, String disabled, String metaData) {
	Texture texture2 = new Texture(Gdx.files.internal(down));
	Texture texture3 = new Texture(Gdx.files.internal(disabled));
	TextureRegion imageDown = new TextureRegion(texture2);
	TextureRegion imageDisabled = new TextureRegion(texture3);
	TextureRegionDrawable drawableDown = new TextureRegionDrawable(imageDown);
	TextureRegionDrawable drawableDisabled = new TextureRegionDrawable(imageDisabled);
	ImageButtonStyle imageButtonStyle = new ImageButtonStyle(drawableDown, drawableDown,
			drawableDown, drawableDown, drawableDown, drawableDown);
	imageButtonStyle.imageDisabled = drawableDisabled;
	mImageButton = new ImageButton(imageButtonStyle);
	mImageButton.setName(metaData);

	if (GLOW == null)
		GLOW = new Texture("data/gfx/glow.png");
	mGlow = new Image(GLOW);
}
 
開發者ID:underclocker,項目名稱:Blob-Game,代碼行數:18,代碼來源:SiggdImageButton.java

示例4: circleButton

import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //導入方法依賴的package包/類
public static ImageButton circleButton(String icon) {
	ButtonStyle circleStyle = skin.get(SkinConstants.STYLE_CIRCLE,
			ButtonStyle.class);
	ImageButtonStyle imageButtonStyle = new ImageButtonStyle(circleStyle);
	imageButtonStyle.imageUp = skin.getDrawable(icon);
	ImageButton imageButton = new ImageButton(imageButtonStyle);
	imageButton.setName(icon);
	return imageButton;
}
 
開發者ID:e-ucm,項目名稱:ead,代碼行數:10,代碼來源:WidgetBuilder.java

示例5: addParameterButton

import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //導入方法依賴的package包/類
private void addParameterButton() {
	parameterButton = new ImageButton(
			((ParameterOptionStyle) style).parameterButton);
	parameterButton.setName(PARAMETER_BUTTON);
	add(parameterButton);
	parameterButton.addListener(new ClickListener() {
		@Override
		public void clicked(InputEvent event, float x, float y) {
			setExpressionEditorVisible(optionContainer.getActor() == optionWidget);
		}
	});
}
 
開發者ID:e-ucm,項目名稱:ead,代碼行數:13,代碼來源:ParameterOption.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.ImageButton.setName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。