本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Image.setTouchable方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setTouchable方法的具体用法?Java Image.setTouchable怎么用?Java Image.setTouchable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Image
的用法示例。
在下文中一共展示了Image.setTouchable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SlotActor
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public SlotActor(Inventory inventory, int num) {
super(new ButtonStyle());
Image image = new Image();
image.setScaling(Scaling.fit);
image.setDrawable(new SlotDrawable());
image.setTouchable(Touchable.disabled);
add(image);
setSize(getPrefWidth(), getPrefHeight());
this.inventory = inventory;
this.num = num;
InventoryManager.newSlot(this);
addListener(new SlotTooltipListener(this));
}
示例2: initialize
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
@Override protected void initialize() {
creaturesList.defaults().pad(2);
creaturesList.padTop(12);
Image left = new Image(Config.skin, "ui-creature-queue-gradient-left");
left.setScaling(Scaling.stretchY);
left.setAlign(Align.left);
left.setTouchable(Touchable.disabled);
Image right = new Image(Config.skin, "ui-creature-queue-gradient-right");
right.setScaling(Scaling.stretchY);
right.setAlign(Align.right);
right.setTouchable(Touchable.disabled);
Stack stack = new Stack();
stack.add(new ScrollPane(creaturesList, new ScrollPane.ScrollPaneStyle()));
stack.add(left);
stack.add(right);
Table content = new Table(Config.skin);
content.setTouchable(Touchable.enabled);
content.setBackground("ui-inventory-ability-window-background");
content.defaults().pad(2);
content.add(new LocLabel("ui-turns-order")).row();
content.add(new Image(Config.skin, "ui-creature-info-line")).width(100).row();
content.add(stack).maxWidth(table.getStage().getWidth() - 45).padRight(4).padLeft(4).row();
table.add(content);
}
示例3: parse
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
@Override
public Actor parse(CocoStudioUIEditor editor, ObjectData widget) {
Table table = new Table();
Size size = widget.getSize();
if (widget.getComboBoxIndex() == 0) { // 无颜色
} else if (widget.getComboBoxIndex() == 1 && widget.getBackColorAlpha() != 0) {// 单色
Pixmap pixmap = new Pixmap((int) size.getX(), (int) size.getY(),
Format.RGBA8888);
pixmap.setColor(editor.getColor(widget.getSingleColor(),
widget.getBackColorAlpha()));
pixmap.fill();
Drawable d = new TextureRegionDrawable(new TextureRegion(
new Texture(pixmap)));
table.setBackground(d);
pixmap.dispose();
}
if (widget.getFileData() != null) {// Panel的图片并不是拉伸平铺的!!.但是这里修改为填充
Drawable tr = editor.findDrawable(widget, widget.getFileData());
if (tr != null) {
Image bg = new Image(tr);
bg.setPosition((size.getX() - bg.getWidth()) / 2,
(size.getY() - bg.getHeight()) / 2);
// bg.setFillParent(true);
bg.setTouchable(Touchable.disabled);
table.addActor(bg);
}
}
table.setClip(widget.isClipAble());
return table;
}