Java 类com.badlogic.gdx.scenes.scene2d.Touchable 实例源码

项目:alquran-alkarem    文件:GameActor.java   
public GameActor(TextureRegion actor_region,float x_pos,float y_pos,Color color,float width,float height) {
actor_texture = actor_region;
xpos = x_pos ;
ypos = y_pos ;
width_ =width ;
height_ = height;
actor_Sprite = new Sprite(actor_texture);
actor_Sprite.setX(xpos);
actor_Sprite.setY(ypos);
if(color != null){   
actor_Sprite.setColor(color);}
actor_Sprite.setSize(width_, height_);
actor_Sprite.setOrigin(width_/2, height_/2);
setBounds(xpos, ypos, width_, height_);
this.setTouchable(Touchable.enabled);
}
项目:Catan    文件:ChooseDiceResultWindow.java   
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;
}
项目:Catan    文件:ChooseDiceResultWindow.java   
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;
}
项目:GDX-Engine    文件:UIManager.java   
public void setMenuVisible(boolean visible){
    if(visible)
        //always make main menu on top when it's visible
        mainMenu.setZIndex(100);

    for(Actor actor : getActors()){
        if(actor != mainMenu){
            if(visible)
                actor.setTouchable(Touchable.disabled);
            else
                actor.setTouchable(Touchable.enabled);
        }
        else
        {
            mainMenu.setVisible(visible);
            mainMenu.setTouchable(Touchable.enabled);
            //make the windows in screen center
            float windowX = (Gdx.graphics.getWidth() - mainMenu.getWidth())/2f;
            float windowY = (Gdx.graphics.getHeight() - mainMenu.getHeight())/2f;
            mainMenu.setPosition(windowX, windowY);
        }
    }
}
项目:Tower-Defense-Galaxy    文件:TabSelector.java   
public TabSelector(final int slotNum, Texture[] icons, final boolean isVertical, int defaultSlot) {
    if(slotNum != icons.length)
        throw new IllegalArgumentException("Icon array length needs to equal slot quantity");
    setTouchable(Touchable.enabled);
    slot = defaultSlot;
    this.slotNum = slotNum;
    this.isVertical = isVertical;
    this.icons = icons;
    selection = new Texture("theme/basic/ui/SelectionBox.png");
    addListener(new InputListener() {
        @Override
        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            if(isVertical)
                slot = (int)(y / (getHeight() / slotNum));
            else
                slot = (int)(x / (getWidth() / slotNum));
            return true;
        }
    });
}
项目:Cubes_2    文件:SlotActor.java   
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));
}
项目:bobbybird    文件:ScrollerPane.java   
public ScrollerPane(TiledDrawable tiledDrawable, float xSpeed, float ySpeed) {
    this.tiledDrawable = tiledDrawable;
    this.xSpeed = xSpeed;
    this.ySpeed = ySpeed;
    xPosition = 0.0f;
    yPosition = 0.0f;

    Image image = new Image(tiledDrawable);

    innerTable = new Table();
    innerTable.add(image).width(5000);
    scrollPane = new ScrollPane(innerTable);
    scrollPane.setTouchable(Touchable.disabled);
    scrollPane.setSmoothScrolling(false);
    this.add(scrollPane).grow();
}
项目:KyperBox    文件:GameState.java   
/**
 * disable all the layers from this state. They no longer receive touch inputs
 * TODO: disable delta//implement pause
 * 
 * @param disable
 */
public void disableLayers(boolean disable) {
    if (disable) {
        this.setTouchable(Touchable.disabled);
        //          uiground.setTouchable(Touchable.disabled);
        //          foreground.setTouchable(Touchable.disabled);
        //          playground.setTouchable(Touchable.disabled);
        //          background.setTouchable(Touchable.disabled);
    } else {
        this.setTouchable(Touchable.enabled);
        //          uiground.setTouchable(Touchable.enabled);
        //          foreground.setTouchable(Touchable.enabled);
        //          playground.setTouchable(Touchable.enabled);
        //          background.setTouchable(Touchable.enabled);
    }
}
项目:libGdx-xiyou    文件:Start.java   
/**
 * 设置当前按钮的点击状态
 *
 * @param disabled true 不能点击 false 可以点击
 */
private void setBtnDisabled(boolean disabled) {
    if (isStart) {
        if (disabled) {
            mStartBtn.setTouchable(Touchable.disabled);
            mRangeBtn.setTouchable(Touchable.disabled);
            mSettingBtn.setTouchable(Touchable.disabled);
        } else {
            mStartBtn.setTouchable(Touchable.enabled);
            mRangeBtn.setTouchable(Touchable.enabled);
            mSettingBtn.setTouchable(Touchable.enabled);
        }
    } else {
        if (disabled) {
            mCheckBox.setTouchable(Touchable.disabled);
            mAboutBtn.setTouchable(Touchable.disabled);
            mBackButton.setTouchable(Touchable.disabled);
        } else {
            mCheckBox.setTouchable(Touchable.enabled);
            mAboutBtn.setTouchable(Touchable.enabled);
            mBackButton.setTouchable(Touchable.enabled);
        }
    }
}
项目:Cubes    文件:SlotActor.java   
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));
}
项目:cll1-gdx    文件:LearningSession.java   
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
    stage.addAction(actionLoadNextChallengeDelayed());
    choice1.setTouchable(Touchable.disabled);
    choice2.setTouchable(Touchable.disabled);
    // update card with total time it has been on display
    activeCardStats.setTotalShownTime(activeCardStats.getTotalShownTime() + currentElapsed);
    if (correct == 1) {
        choice1.addActor(imgCheckmark);
        ding();
    } else {
        choice1.addActor(imgXmark);
        if (activeCardStats.isCorrect()) {
            activeCardStats.pimsleurSlotDec();
            activeCardStats.triesRemainingInc();
            activeCardStats.setCorrect(false);
        }
        buzz();
    }
    return true;
}
项目:cll1-gdx    文件:LearningSession.java   
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
    stage.addAction(actionLoadNextChallengeDelayed());
    choice1.setTouchable(Touchable.disabled);
    choice2.setTouchable(Touchable.disabled);
    // update card with total time it has been on display
    activeCardStats.setTotalShownTime(activeCardStats.getTotalShownTime() + currentElapsed);
    if (correct == 2) {
        choice2.addActor(imgCheckmark);
        ding();
    } else {
        choice2.addActor(imgXmark);
        if (activeCardStats.isCorrect()) {
            activeCardStats.pimsleurSlotDec();
            activeCardStats.triesRemainingInc();
            activeCardStats.setCorrect(false);
        }
        buzz();
    }
    return true;
}
项目:GDefence    文件:LevelButton.java   
private void load(){
        tooltip = new LevelTooltip(this, GDefence.getInstance().assetLoader.get("skins/uiskin.json", Skin.class));
        tooltip.setTouchable(Touchable.disabled);
        //CampainMap.getStage().addActor(tooltip);
//        GDefence.getInstance().getCampainMap().getStage().addActor(tooltip);
        addListener(new TooltipListener(tooltip, true));


        addListener(new InputListener() {
            public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
                if (!isLocked()) {
                    GDefence.getInstance().getLevelPreparationScreen().setLevel(number);
                    GDefence.getInstance().switchScreen(GDefence.getInstance().getLevelPreparationScreen());
                }
                return true;
            }
        });



    }
项目:cachebox3.0    文件:ValidationTask.java   
public void setReadyIcon() {
    //Ready , set icon on render Thread
    Gdx.app.postRunnable(new Runnable() {
        @Override
        public void run() {
            if (hasWarn() || hasError()) {
                if (hasError()) {
                    Image errorImage = new Image(game.skin.getRegion("error"));
                    ValidationTask.this.cell.setActor(errorImage);
                } else {
                    Image warnImage = new Image(game.skin.getRegion("warn"));
                    ValidationTask.this.cell.setActor(warnImage);
                }
            } else {
                Image readyImage = new Image(game.skin.getRegion("valid"));
                ValidationTask.this.cell.setActor(readyImage);
            }
            ValidationTask.this.cell.getActor().addListener(clickListener);
            ValidationTask.this.cell.getActor().setTouchable(Touchable.enabled);
            Gdx.graphics.requestRendering();
        }
    });
}
项目:dice-heroes    文件:SpawnController.java   
private void place(Creature creature, int x, int y) {
    WorldObjectView spawnView = dieToIconToSpawn.get(creature.description);
    placed.add(creature);
    refreshStartButton();
    world.add(x, y, creature);
    WorldObjectView worldView = world.getController(ViewController.class).getView(creature);
    EventListener listener = createMoveSpawnedListener(creature, worldView, spawnView);
    EventListener prev = moveListeners.remove(worldView);
    if (prev != null) {
        worldView.removeListener(prev);
    }
    moveListeners.put(worldView, listener);
    worldView.addListener(listener);
    spawnView.getColor().a = 0f;
    spawnView.setTouchable(Touchable.disabled);
}
项目:dice-heroes    文件:TutorialMessageWindow.java   
@Override protected void initialize() {
    Table table = new Table(Config.skin);
    table.setBackground(Config.skin.getDrawable("ui-tutorial-window-background"));

    label = new LocLabel("", DieMessageWindow.ACTIVE);
    label.setWrap(true);
    label.setAlignment(Align.center);

    table.setTouchable(Touchable.disabled);

    Label tapToContinue = new LocLabel("tap-to-continue", DieMessageWindow.INACTIVE);
    tapToContinue.setWrap(true);
    tapToContinue.setAlignment(Align.center);

    if (image != null) {
        image.setTouchable(Touchable.disabled);
        table.add(image).padTop(-15 - dy).row();
    }
    final Cell<LocLabel> cell = table.add(label).width(100);
    if (forceLabelHeight) cell.height(labelHeight);
    cell.row();
    table.add(new Image(Config.skin, "ui-tutorial-window-line")).padTop(4).row();
    table.add(tapToContinue).width(80).row();

    this.table.add(table);
}
项目:dice-heroes    文件:DieMessageWindow.java   
@Override protected void initialize() {
    Table table = new Table(Config.skin);
    table.setBackground(Config.skin.getDrawable("ui-tutorial-window-background"));
    label = new LocLabel("", ACTIVE);
    label.setWrap(true);
    label.setAlignment(Align.center);

    table.setTouchable(Touchable.disabled);

    Label tapToContinue = new LocLabel("tap-to-continue", INACTIVE);
    tapToContinue.setWrap(true);
    tapToContinue.setAlignment(Align.center);

    table.add(imageTable).padTop(6).row();
    table.add(label).width(100).row();
    table.add(new Image(Config.skin, "ui-tutorial-window-line")).padTop(4).row();
    table.add(tapToContinue).width(80).row();

    this.table.add(table);
}
项目:dice-heroes    文件:PvpPlayState.java   
private void showPrepareWindow() {
    new BlockingWindow() {
        @Override protected void doShow(IFuture<?> future) {
            super.doShow(future);
            table.setTouchable(Touchable.enabled);
            table.row();
            table.add(new LocLabel("ui-waiting-another-player"));
        }
        @Override public boolean handleBackPressed() {
            if (isShown()) {
                callback.onCancel(session, Tuple3.make(false, Option.<String>none(), Option.<Throwable>none()), option(world), option(playersToParticipants));
                hide();
            }
            return true;
        }
        @Override protected boolean canBeClosed() {
            return true;
        }
    }.show(prepareFuture = new Future<Void>());
}
项目:dice-heroes    文件:CraftingPane.java   
public CraftingPane(int elementsCount, Array<Ability> recipes) {
        super(Config.skin);
        this.inputs = new ObjectMap<Actor, ItemIcon>(elementsCount);
        this.count = elementsCount;
        this.recipes = recipes;
//        defaults().pad(2);
        for (int i = 0; i < elementsCount; i++) {
            Image image = new Image(Config.skin, "ui-crafting-slot");
            image.setName("slot#" + i);
            inputs.put(image, null);
            add(image).size(26);
            if (i != elementsCount - 1) {
                add(new Tile("ui-plus")).pad(1);
            } else {
                add(new Tile("ui-equals")).pad(1);
            }
        }
        add(output).size(26);
        setTouchable(Touchable.enabled);
    }
项目:dice-heroes    文件:CraftingPane.java   
public boolean putIngredient(ItemIcon icon) {
    Vector2 stageCoordinates = icon.localToStageCoordinates(tmp.set(icon.getWidth() / 2, icon.getHeight() / 2));
    Vector2 local = this.stageToLocalCoordinates(stageCoordinates);
    Actor actor = hit(local.x, local.y, true);
    if (actor != null && inputs.containsKey(actor)) {
        ItemIcon added = new ItemIcon(icon.item);
        addActor(added);
        added.setTouchable(Touchable.disabled);
        added.setPosition(actor.getX() + (actor.getWidth() - added.getWidth()) / 2, actor.getY() + (actor.getHeight() - added.getHeight()) / 2f);
        ItemIcon prev = inputs.put(actor, added);
        if (prev != null) {
            prev.setTouchable(Touchable.enabled);
            prev.remove();
            fire(new IngredientReplaced(prev));
        }
        updateResult();
        return true;
    } else {
        return false;
    }
}
项目:dice-heroes    文件:DiePane.java   
public DiePane(Die die, UserData userData, Group diceWindowGroup) {
    this.die = die;
    this.userData = userData;
    this.diceWindowGroup = diceWindowGroup;
    shopComparator = Ability.shopComparator(die);
    setTransform(false);

    addActor(splitPane);
    splitPane.clearListeners();

    initInfoPanel();
    initParamsPanel();

    splitPane.setSplitAmount(1f);
    splitPane.setHeight(info.getPrefHeight());
    splitPane.layout();
    setSize(getPrefWidth(), splitPane.getHeight());
    params.setTouchable(Touchable.disabled);
}
项目:cocos-ui-libgdx    文件:T.java   
public T isButton(final TClickListener clickListener) {
    actor.setTouchable(Touchable.enabled);
    actor.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            actor.addAction(Actions.sequence(Actions.scaleTo(0.9f, 0.9f, 0.1f), Actions.scaleTo(1, 1, 0.1f), Actions.run(new Runnable() {
                @Override
                public void run() {
                    if (clickListener != null) {
                        clickListener.onClick(actor);
                    }
                }
            })));
        }
    });

    return this;
}
项目:ChiptuneTracker    文件:NewFileListener.java   
public NewFileListener(FileChooser fileChooser, DataManager dataManager) {
    this.fileChooser = fileChooser;
    this.dataManager = dataManager;

    if(ChiptuneTracker.getInstance().isChangeData()) {
        String text;
        if(dataManager.getCurrentFile() == null) {
            text = "New file has been modified. Save changes?";
        }
        else {
            text = dataManager.getCurrentFile()+" has been modified. Save changes?";
        }

        Dialogs.showOptionDialog(ChiptuneTracker.getInstance().getAsciiTerminal().getStage(), "Save Resource", text, Dialogs.OptionDialogType.YES_NO_CANCEL, this);

        ((View) ChiptuneTracker.getInstance().getScreen()).setListActorTouchables(Touchable.disabled);
    }
    else {
        clearAction();
        additionalYesActions();
    }
}
项目:ChiptuneTracker    文件:SaveFileListener.java   
@Override
public void selected(Array<FileHandle> files) {
    File file = files.first().file();
    if(!file.exists() || file.canWrite()) {
        Serializer serializer = new Persister();
        try {
            serializer.write(ChiptuneTracker.getInstance().getData(), file);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if(dataManager.getCurrentFile() == null) {
            dataManager.setCurrentFile(new StringBuilder());
        }
        dataManager.getCurrentFile().setLength(0);
        dataManager.getCurrentFile().append(file.getAbsolutePath());
        ChiptuneTracker.getInstance().setChangeData(false);
        additionalActions();
    }
    else {
        Dialogs.showErrorDialog(ChiptuneTracker.getInstance().getAsciiTerminal().getStage(), "Unable to write in the file !");
    }
    ((View) ChiptuneTracker.getInstance().getScreen()).setListActorTouchables(Touchable.enabled);
}
项目:gdx-texture-packer-gui    文件:InputFileListAdapter.java   
private void processPathText() {
    if (pathProcessed) return;
    pathProcessed = true;

    boolean fileShortened = false;
    String origFilePath = inputFile.getFileHandle().path();
    String filePath = origFilePath;

    filePath = Scene2dUtils.ellipsisFilePath(filePath, lblName.getStyle().font, lblName.getWidth());
    fileShortened = !origFilePath.equals(filePath);
    filePath = Scene2dUtils.colorizeFilePath(filePath, inputFile.getFileHandle().isDirectory(), "light-grey", "white");

    lblName.setText(filePath);

    // Show tooltip only if displayed file name was shortened
    tooltip.setTarget(fileShortened ? lblName : null);
    tooltip.setText(Scene2dUtils.colorizeFilePath(origFilePath, inputFile.getFileHandle().isDirectory(), "light-grey", "white"));
    tooltip.setTouchable(Touchable.disabled);
}
项目:gdx-texture-packer-gui    文件:PatchGrid.java   
public PatchGrid(Skin skin, Color primaryColor, GridValues values) {
    this.primaryColor = new Color(primaryColor);
    this.values = values;
    setTouchable(Touchable.enabled);

    whiteDrawable = skin.getDrawable("white");
    gridNodeDrawable = skin.getDrawable("custom/nine-patch-gird-node");

    left = new PatchLine(whiteDrawable, primaryColor);
    right = new PatchLine(whiteDrawable, primaryColor);
    top = new PatchLine(whiteDrawable, primaryColor);
    bottom = new PatchLine(whiteDrawable, primaryColor);
    patchLines.addAll(left, right, top, bottom);

    addActor(left);
    addActor(right);
    addActor(top);
    addActor(bottom);

    lineDragListener = new LineDragListener();
    addListener(lineDragListener);

    values.addListener(modelListener = new ModelChangeListener());
}
项目:rectball    文件:GameScreen.java   
/**
 * This method pauses the game. It is executed in one of the following
 * situations: first, the user presses PAUSE button. Second, the user
 * presses BACK button. Third, the user pauses the game (when the game
 * is restored the game is still paused).
 */
private void pauseGame() {
    paused = true;

    // Show the pause dialog unless you have already stop the game.
    if (!game.getState().isTimeout()) {
        showPauseDialog();
    }

    // If the game has started, pause it.
    if (running && !game.getState().isTimeout()) {
        board.setColoured(false);
        board.setTouchable(Touchable.disabled);
        timer.setRunning(false);
    }
}
项目:rectball    文件:GameScreen.java   
/**
 * This method resumes the game. It is executed in one of the following
 * situations: first, the user presses CONTINUE button on pause screen.
 * Second, the user presses BACK on the pause screen.
 */
private void resumeGame() {
    paused = false;

    // If the countdown has finished but the game is not running is a
    // condition that might be triggered in one of the following cases.
    // 1) The user has paused the game during the countdown. When the
    //    countdown finishes, because the game is paused, the game does
    //    not start.
    // 2) The user was leaving the game during the countdown. Same.
    if (!running && game.getState().isCountdownFinished()) {
        running = true;
        game.player.playSound(SoundCode.SUCCESS);
    }

    if (running && !game.getState().isTimeout()) {
        board.setColoured(true);
        board.setTouchable(Touchable.enabled);
        timer.setRunning(true);
    }
}
项目:Roguelike    文件:InventoryPanel.java   
public InventoryPanel( Skin skin, Stage stage )
{
    this.TileSize = 32;
    this.skin = skin;
    this.stage = stage;

    this.tileBackground = AssetManager.loadSprite( "GUI/TileBackground" );
    this.tileBorder = AssetManager.loadSprite( "GUI/TileBorder" );

    this.buttonUp = AssetManager.loadSprite( "GUI/Button" );
    this.buttonDown = AssetManager.loadSprite( "GUI/ButtonDown" );
    this.buttonBorder = AssetManager.loadSprite( "GUI/ButtonBorder" );

    header = new HeaderLine( skin, stage, buttonUp, tileBorder, TileSize );
    body = new InventoryBody( skin, stage, tileBackground, tileBorder, 32 );

    add( header ).width( Value.percentWidth( 1, this ) );
    row();
    add( body ).expand().fill().width( Value.percentWidth( 1, this ) );

    setTouchable( Touchable.childrenOnly );
}
项目:lets-code-game    文件:UiApp.java   
@Override
public void render() {
    float delta = Gdx.graphics.getDeltaTime();
    if (durAccum > 0f) {
        durAccum -= delta;
        if (durAccum <= 0f) {
            currentScreen.hide();
            currentScreen.remove();
            currentScreen = nextScreen;
            currentScreen.setTouchable(Touchable.enabled);
            currentScreen.setPosition(0f, 0f);
            nextScreen = null;
        }
    }
    Gdx.gl.glClearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a);
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    stage.act(delta);
    stage.draw();
}
项目:OdysseeDesMaths    文件:MenuPrincipal.java   
private void play() {
    AlphaAction alphaAction = new AlphaAction();
    alphaAction.setAlpha(0);
    alphaAction.setDuration(0.5f);
    play.addAction(alphaAction);
    play.setTouchable(Touchable.disabled);

    MoveToAction moveToAction = new MoveToAction();
    moveToAction.setPosition(gameTitle.getX(), HEIGHT * 12 / 13 - gameTitle.getHeight());
    moveToAction.setDuration(2);
    gameTitle.addAction(moveToAction);

    Timer.instance().clear();
    gameTitle.setText("L'Odyssée des Maths");
    currentState = State.TRANSITION;
}
项目:TheConsole_POC    文件:ConsoleView.java   
public ConsoleView(Skin skin) {
    this.skin = skin;
    entriesStack = new Table(skin);
    entriesStack.setFillParent(true);
    scrollPane = new ScrollPane(entriesStack, skin);
    scrollPane.setFadeScrollBars(false);
    scrollPane.setScrollbarsOnTop(false);
    scrollPane.setOverscroll(false, false);

    inputField = new TextField("", skin);

    this.add(scrollPane).expand().fill().pad(2).row();
    this.add(inputField).expandX().fillX().pad(4);

    setTouchable(Touchable.enabled);

    clearEntries();
}
项目:umbracraft    文件:MapEditorWidget.java   
/** Shows an entity popup for the tile at coordinates i,j
 * @param i
 * @param j */
public void showEntityPopup(int i, int j) {
    popupTable.setVisible(true);
    mapTable.setTouchable(Touchable.disabled);
    popupTable.clear();
    popupTable.setBackground(Drawables.get("black"));
    EntityReferenceDefinition entity = module.getDefinition().findEntity(i, j);
    if (entity == null) {
        // populate with new data
        entity = new EntityReferenceDefinition();
        entity.x = i;
        entity.y = j;
        entity.name = "";
        module.getDefinition().entities.add(entity);
    }
    WidgetUtils.popupTitle(popupTable, "Add/Remove Entity " + entity.name, closeListener(entity));
    module.populate(popupTable, EntityReferenceDefinition.class, entity, populateConfig());
    popupTable.row();
    final Table buttonTable = new Table();
    buttonTable.add(WidgetUtils.button("Create", closeListener(entity)));
    buttonTable.add(WidgetUtils.button("Delete", deleteListener(entity)));
    popupTable.add(buttonTable).expandX().fill();
}
项目:ProjectRiddle    文件:Final.java   
/**
 * Contructor de la clase
 */

public Final(){
    stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
    camara = new OrthographicCamera();
    batch = new SpriteBatch();

    Gdx.input.setInputProcessor(stage);

    textura = new Texture(Gdx.files.internal(GestorImagen.URL_PANTALLA_FINAL)); 
    musica = Gdx.audio.newMusic(Gdx.files.internal("Musica/Tension.mp3"));
    musica.play();

    // instanciamos la cámara
    camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f, 0);
    viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);

    salir = new BotonSalir(game, true);
    salir.setTouchable(Touchable.enabled);

    stage.addActor(salir);
}
项目:ProjectRiddle    文件:Introduccion.java   
/**
 * Constructor de la clase
 */

public Introduccion() {
    stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
    camara = new OrthographicCamera();
    batch = new SpriteBatch();

    Gdx.input.setInputProcessor(stage);

    textura = new Texture(Gdx.files.internal(GestorImagen.URL_PANTALLA_INTRO)); 
    musica = Gdx.audio.newMusic(Gdx.files.internal("Musica/Tension.mp3"));
    musica.play();

    // instanciamos la cámara
    camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f, 0);
    viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);

    //Actores
    botonContinuar = new BotonContinuar(game);
    botonContinuar.setTouchable(Touchable.enabled);

    stage.addActor(botonContinuar);
}
项目:ProjectRiddle    文件:Creditos.java   
/**
 * Contructor de la clase
 */

public Creditos(){
    stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
    camara = new OrthographicCamera();
    batch = new SpriteBatch();

    Gdx.input.setInputProcessor(stage);

    pantalla = new Texture(Gdx.files.internal(GestorImagen.URL_PANTALLA_CREDITOS)); 

    // instanciamos la cámara
    camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f, 0);
    viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);

    botonSalir = new BotonSalirCreditos(game);
    botonSalir.setTouchable(Touchable.enabled);

    stage.addActor(botonSalir);
}
项目:ProjectRiddle    文件:Diccionario.java   
public Diccionario(){
    stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
    camara = new OrthographicCamera();
    batch = new SpriteBatch();

    Gdx.input.setInputProcessor(stage);

    pantalla = new Texture(Gdx.files.internal(GestorImagen.URL_PANTALLA_DICCIONARIO)); 

    salirDiccionario = new BotonSalirDiccionario(game);
    salirDiccionario.setTouchable(Touchable.enabled);

    // instanciamos la cámara
    camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f, 0);
    viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);

    // Música
    musica = Gdx.audio.newMusic(Gdx.files.internal("Musica/Inventario.mp3"));
    musica.setLooping(true);
    musica.play();

    stage.addActor(salirDiccionario);
}
项目:droidtowers    文件:Toast.java   
public Toast() {
    setVisible(false);
    label = FontManager.RobotoBold18.makeLabel("");

    defaults();
    setBackground(TowerAssetManager.ninePatchDrawable(TowerAssetManager.WHITE_SWATCH, Colors.DARKER_GRAY));
    pad(Display.devicePixel(12));
    add(label);
    pack();
    setTouchable(Touchable.enabled);
    addListener(new ClickListener() {
        @Override
        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            removeListener(this);
            fadeOut();
            return true;
        }
    });
}
项目:droidtowers    文件:PopOver.java   
public PopOver() {
    triangle = texture(TowerAssetManager.WHITE_SWATCH_TRIANGLE);
    swatch = texture(TowerAssetManager.WHITE_SWATCH);
    background = TowerAssetManager.texture("hud/window-bg.png");
    background.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

    content = new Table();
    content.defaults().top().left().space(Display.devicePixel(6));

    setTouchable(Touchable.enabled);
    addListener(new InputListener() {
        @Override
        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            return true;
        }
    });
}
项目:vis-editor    文件:AtlasItem.java   
public AtlasItem (String relativeAtlasPath, AtlasRegion region) {
    super(VisUI.getSkin());
    this.relativeAtlasPath = relativeAtlasPath;
    this.region = region;

    assetDescriptor = new AtlasRegionAsset(relativeAtlasPath, region.name);

    setTouchable(Touchable.enabled);
    setBackground("menu-bg");

    Image img = new Image(region);
    img.setScaling(Scaling.fit);
    add(img).expand().fill().row();

    VisLabel name = new VisLabel(region.name, "small");
    name.setWrap(true);
    name.setAlignment(Align.center);
    add(name).expandX().fillX();
}