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