本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.setTouchable方法的典型用法代码示例。如果您正苦于以下问题:Java Table.setTouchable方法的具体用法?Java Table.setTouchable怎么用?Java Table.setTouchable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Table
的用法示例。
在下文中一共展示了Table.setTouchable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupRedDiceOption
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
private Table setupRedDiceOption(int diceNumber) {
Table redDiceOption = new Table();
redDiceOption.setBackground(redBackground);
redDiceOption.add(new Label("" + diceNumber, CatanGame.skin));
redDiceOption.setTouchable(Touchable.enabled);
redDiceOption.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
if (chosenRedDice == diceNumber) {
System.out.println("discard choice of " + diceNumber);
chosenRedDice = 0;
enableAllTouchablesRed();
} else {
System.out.println("choose " + diceNumber);
chosenRedDice = diceNumber;
disableAllTouchablesRed();
redDiceOption.setTouchable(Touchable.enabled);
redDiceOption.setBackground(redBackground);
}
}
});
return redDiceOption;
}
示例2: setupYellowDiceOption
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
private Table setupYellowDiceOption(int diceNumber) {
Table yellowDiceOption = new Table();
yellowDiceOption.setBackground(yellowBackground);
yellowDiceOption.add(new Label("" + diceNumber, CatanGame.skin));
yellowDiceOption.setTouchable(Touchable.enabled);
yellowDiceOption.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
if (chosenYellowDice == diceNumber) {
System.out.println("discard choice of " + diceNumber);
chosenYellowDice = 0;
enableAllTouchablesYellow();
} else {
System.out.println("choose " + diceNumber);
chosenYellowDice = diceNumber;
disableAllTouchablesYellow();
yellowDiceOption.setTouchable(Touchable.enabled);
yellowDiceOption.setBackground(yellowBackground);
}
}
});
return yellowDiceOption;
}
示例3: create_pages_texture
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
private void create_pages_texture() {
// TODO Auto-generated method stub
Table container = new Table();
Table table = new Table();
container.setDebug(debug_pages);
table.setDebug(debug_pages);
container.setFillParent(true);
pages_scroll_pane = new ScrollPane(table);
pages_scroll_pane.layout();
container.add(pages_scroll_pane).width(screen_width).height(screen_height);
;
pages_scroll_pane.setTouchable(Touchable.enabled);
pages_scroll_pane.setBounds(0, 0, screen_width, screen_height);
container.setBounds(0,0,screen_width,screen_height);
container.setTouchable(Touchable.enabled);
pages_stage.addActor(container);
for (int i = 1 ;i <=pages_no ;i++){
Table tablea = new Table();
// tablea.setColor((float)Math.random(),(float)Math.random(),(float)Math.random(),1);
tablea.setDebug(debug_pages);
table.add(tablea).width(screen_width).height(screen_height);
table.row();
pages_draw_stage.addActor(new PageSeen(i));
}
}
示例4: disableAllTouchablesRed
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
private void disableAllTouchablesRed() {
for (Table t : redDieOptions) {
t.setBackground(redBackgroundClicked);
t.setTouchable(Touchable.disabled);
}
}
示例5: enableAllTouchablesRed
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
private void enableAllTouchablesRed() {
for (Table t : redDieOptions) {
t.setBackground(redBackground);
t.setTouchable(Touchable.enabled);
}
}
示例6: disableAllTouchablesYellow
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
private void disableAllTouchablesYellow() {
for (Table t : yellowDieOptions) {
t.setBackground(yellowBackgroundClicked);
t.setTouchable(Touchable.disabled);
}
}
示例7: enableAllTouchablesYellow
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
private void enableAllTouchablesYellow() {
for (Table t : yellowDieOptions) {
t.setBackground(yellowBackground);
t.setTouchable(Touchable.enabled);
}
}