Java 类com.badlogic.gdx.Input.TextInputListener 实例源码

项目:elin-game    文件:DialogStageScript.java   
private void showEnigma() {
    Gdx.input.getTextInput(new TextInputListener() {
        @Override
        public void input(String text){
            message = text;
            if(message.equals("aspirateur") /*== "aspirateur"*/){
                Gdx.input.vibrate(1000); 
                enigma = true;
                tryAgain = false;
                System.out.println("true");
            }
            else{
                tryAgain = true;
            }
        }

        @Override
        public void canceled(){
            message = "no";
        }
    }, "Je ne respire jamais, mais j'ai beaucoup de soufle. Qui suis-je ?", "", "");
}
项目:libgdxcn    文件:TextInputDialogTest.java   
public void render () {
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    batch.begin();
    font.draw(batch, message, 10, 40);
    batch.end();

    if (Gdx.input.justTouched()) {
        Gdx.input.getTextInput(new TextInputListener() {
            @Override
            public void input (String text) {
                message = "message: " + text + ", touch screen for new dialog";
            }

            @Override
            public void canceled () {
                message = "cancled by user";
            }
        }, "enter something funny", "funny", "something funny");
    }
}
项目:ead    文件:MokapDesktopPlatform.java   
@Override
public void askForFile(Controller controller,
        final FileChooserListener listener) {
    Gdx.input.getTextInput(new TextInputListener() {

        @Override
        public void input(final String text) {
            Gdx.app.postRunnable(new Runnable() {
                @Override
                public void run() {
                    listener.fileChosen(text,
                            FileChooserListener.Result.SUCCESS);

                }
            });
        }

        @Override
        public void canceled() {
        }

    }, "File path!", "", "");
}
项目:ead    文件:MokapDesktopPlatform.java   
@Override
public void askForAudio(Controller controller,
        final FileChooserListener listener) {
    Gdx.input.getTextInput(new TextInputListener() {

        @Override
        public void input(final String text) {
            Gdx.app.postRunnable(new Runnable() {

                @Override
                public void run() {
                    listener.fileChosen(text,
                            FileChooserListener.Result.SUCCESS);
                }
            });
        }

        @Override
        public void canceled() {
        }

    }, "File path!", "", "");
}
项目:killingspree    文件:MainMenuScreen.java   
@Override
public void show() {
    font = game.getFont(170);
    batch = new SpriteBatch();
    camera = new OrthographicCamera();
    viewport = new FitViewport(1280, 720, camera);
    camera.setToOrtho(false, 1280, 720);
    buttons = new ArrayList<MyButton>();
    addAllButtons();
    final Preferences prefs = Gdx.app.getPreferences("profile");
    String name = prefs.getString("name");
    name = name.trim();
    if (name.length() == 0) {
        Gdx.input.getTextInput(new TextInputListener() {

            @Override
            public void input(String text) {
                prefs.putString("name", text);
                prefs.flush();
            }

            @Override
            public void canceled() {
            }
        }, "Enter name", "");
    }
}
项目:killingspree    文件:ClientDiscoveryScreen.java   
private void processButton() {
    if (currentButton == backButton) {
        game.setScreen(new MainMenuScreen(game));
    } else if (currentButton == refreshButton) {
        addIpButtons();
    } else if (currentButton == manualIpButton) {
        if (pressedButton) {
            return;
        }
        pressedButton = true;

        Gdx.input.getTextInput(new TextInputListener() {

            @Override
            public void input(String text) {
                joinGame(text);
            }

            @Override
            public void canceled() {
                pressedButton = false;
            }
        }, "Enter IP", "");

    } else {
        if (!pressedButton) {
            pressedButton = true;
            joinGame(currentButton.getText());
        }
    }
}
项目:ead    文件:CreateVariable.java   
@Override
public void perform(Object... args) {
    resultListener = (TextInputListener) args[0];
    ModelEntity game = (ModelEntity) controller.getModel()
            .getResource(ModelStructure.GAME_FILE).getObject();
    variables = Q.getComponent(game, Variables.class);
    names.clear();
    for (VariableDef def : variables.getVariablesDefinitions()) {
        names.add(def.getName());
    }

    Gdx.input.getTextInput(this, i18N.m("new.variable"), newVariableName(),
            "");
}
项目:touhou-java    文件:GameModel.java   
public void nextStage() {
    this.stageid++;
    if (stageid >= getStageGroupbyId(this.diffcultid).getStage_group()
            .size()) {
        // TODO 游戏通关
        Gdx.input.getTextInput(new TextInputListener() {

            @Override
            public void input(String text) {
                Preferences pref = Gdx.app.getPreferences("highscore");
                pref.putInteger(text, GameModel.this.getScore());
                pref.flush();
            }

            @Override
            public void canceled() {

            }
        }, "恭喜通关!请留下您的大名:", "玩家");
        BulletGame.setCurrentScreen(BulletGame.homeScreen);
        objList.clear();
    } else {
        // TODO 开始下一关
        this.currentStage = getStageGroupbyId(diffcultid).getStagebyId(stageid);
        currentStage.getTask().reset();
        objList.clear();
        getObjList().add(player.getGrazer());
        getObjList().add(player);
    }
}
项目:libgdxcn    文件:RemoteInput.java   
@Override
public void getTextInput (TextInputListener listener, String title, String text, String hint) {
    Gdx.app.getInput().getTextInput(listener, title, text, hint);
}
项目:libgdxcn    文件:GwtTestWrapper.java   
@Override
public void getTextInput (TextInputListener listener, String title, String text, String hint) {
    input.getTextInput(listener, title, text, hint);
}
项目:chainball    文件:Settings.java   
private void update() {
    if (Gdx.input.isKeyPressed(Keys.BACK) || Gdx.input.isKeyPressed(Keys.ESCAPE)){
        Chainball.setScreen(Assets.mainMenu);
    }
    if (Gdx.input.justTouched()){
        if (nickname.contains(Chainball.getX(), Chainball.getY())){
            name = "";
            Gdx.input.getTextInput(new TextInputListener() {

                @Override
                public void input(String text) {
                    System.out.println("Text length: " + text.length());
                    if (text.length() > Constants.MAX_NAME_LENGTH){
                        text = text.substring(0, Constants.MAX_NAME_LENGTH);
                        Prefs.setName(text);
                    } else if (text.length() < 1){
                        text = Constants.DEFAULT_TEXT; 
                    } else {
                        Prefs.setName(text);
                    }
                    name = text;
                }

                @Override
                public void canceled() {
                    name = "Enter a name";
                }
            }, title, textInitial);
        } else if (sound.contains(Chainball.getX(), Chainball.getY())){
            if (Prefs.soundEffects()){
                Prefs.setSoundEffects(false);
            } else {
                Assets.green.play(Constants.VOLUME);
                Prefs.setSoundEffects(true);
            }
        } else if (music.contains(Chainball.getX(), Chainball.getY())){
            if (Prefs.music()){
                Assets.stopCurrentSong();
                Prefs.setMusic(false);
            } else {
                Assets.green.play(Constants.VOLUME);
                Prefs.setMusic(true);
                Assets.play(Assets.mainMenuSong);
            }
        } else if (save.contains(Chainball.getX(), Chainball.getY())){
            Chainball.setScreen(Assets.mainMenu);
        }
    }
}
项目:ead    文件:AndroidPlatform.java   
@Override
public void getMultilineTextInput(final TextInputListener listener,
        final String title, final String text, final I18N i18n) {
    final EditorActivity activity = (EditorActivity) Gdx.app;
    activity.post(new Runnable() {
        public void run() {
            AlertDialog.Builder alert = new AlertDialog.Builder(activity);
            alert.setTitle(title);
            final EditText input = new EditText(activity);
            input.setText(text);
            input.setSingleLine(false);
            input.setHorizontalScrollBarEnabled(false);
            input.setVerticalScrollBarEnabled(true);
            input.setInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
                    | InputType.TYPE_TEXT_FLAG_MULTI_LINE
                    | InputType.TYPE_CLASS_TEXT);
            alert.setView(input);
            alert.setPositiveButton(i18n.m("accept"),
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,
                                int whichButton) {
                            Gdx.app.postRunnable(new Runnable() {
                                @Override
                                public void run() {
                                    listener.input(input.getText()
                                            .toString());
                                }
                            });
                        }
                    });
            alert.setOnCancelListener(new OnCancelListener() {
                @Override
                public void onCancel(DialogInterface arg0) {
                    Gdx.app.postRunnable(new Runnable() {
                        @Override
                        public void run() {
                            listener.canceled();
                        }
                    });
                }
            });
            alert.show();
        }
    });

}
项目:ead    文件:CreateVariable.java   
public CreateVariable() {
    super(true, false, TextInputListener.class);
}
项目:ead    文件:DesktopPlatform.java   
@Override
public void getMultilineTextInput(TextInputListener listener, String title,
        String text, I18N i18n) {
}
项目:ead    文件:Platform.java   
public void getMultilineTextInput(TextInputListener listener,
final String title, final String text, I18N i18n);
项目:ead    文件:MockPlatform.java   
@Override
public void getMultilineTextInput(TextInputListener listener, String title,
        String text, I18N i18n) {
}
项目:ingress-indonesia-dev    文件:AndroidInput$4.java   
AndroidInput$4(AndroidInput paramAndroidInput, String paramString1, String paramString2, Input.TextInputListener paramTextInputListener)
{
}
项目:ingress-indonesia-dev    文件:AndroidInput.java   
public final void getPlaceholderTextInput(Input.TextInputListener paramTextInputListener, String paramString1, String paramString2)
{
  this.handle.post(new AndroidInput.4(this, paramString1, paramString2, paramTextInputListener));
}
项目:ingress-indonesia-dev    文件:AndroidInput.java   
public final void getTextInput(Input.TextInputListener paramTextInputListener, String paramString1, String paramString2)
{
  this.handle.post(new AndroidInput.3(this, paramString1, paramString2, paramTextInputListener));
}
项目:ingress-indonesia-dev    文件:AndroidInput$3.java   
AndroidInput$3(AndroidInput paramAndroidInput, String paramString1, String paramString2, Input.TextInputListener paramTextInputListener)
{
}
项目:ingress-indonesia-dev    文件:RemoteInput.java   
public void getPlaceholderTextInput(Input.TextInputListener paramTextInputListener, String paramString1, String paramString2)
{
  Gdx.app.getInput().getPlaceholderTextInput(paramTextInputListener, paramString1, paramString2);
}
项目:ingress-indonesia-dev    文件:RemoteInput.java   
public void getTextInput(Input.TextInputListener paramTextInputListener, String paramString1, String paramString2)
{
  Gdx.app.getInput().getTextInput(paramTextInputListener, paramString1, paramString2);
}
项目:libgdxcn    文件:MockInput.java   
@Override
public void getTextInput(TextInputListener listener, String title, String text, String hint) {

}