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