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