0
\$\begingroup\$
textStyle = new LabelStyle();
textStyle.font = font;
textStyle.fontColor=Color.GREEN;

EnterTextCasheir= new Label("",textStyle);
EnterTextCasheir.setBounds(AssetsHelper.convertWidth(158),
        AssetsHelper.convertHeight(162),
        AssetsHelper.convertWidth(180),
        AssetsHelper.convertHeight(55));
EnterTextCasheir.setWrap(true);
EnterTextCasheir.setFontScale(1f, 1.5f); 
EnterTextCasheir.setSize(CashierCounterEnterBoxZoomImage.getWidth(),
        CashierCounterEnterBoxZoomImage.getHeight());

table4.addActor(EnterTextCasheir);

EnterTextCasheir.addListener(new InputListener() {
    private boolean EnterTextCasheirBol;

    public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
        if(!EnterTextCasheirBol)
        {
            EnterTextCasheirBol = true;
            Gdx.input.getTextInput(new TextInputListener() {
                private String CasheirBoxStg;

                @Override
                public void input (String text) {
                    EnterTextCasheirBol = false;
                    EnterTextCasheir.setText(text);

                    CasheirBoxStg = (String) text;
                }
            }
        ...
        }
    }
}

Its my brief code;I am not able to display the text into single line ;its coming in 2 lines can anyone help me to resolve.Thank you

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

If you don't want multiple lines change:

EnterTextCasheir.setWrap(true);

to

EnterTextCasheir.setWrap(false);

You'll likely also have to increase the width of your text box. Wrapping occurs when the text doesn't fit in the specified width, it wraps to a new line.

Alternatively you can use less text or just make the text box wider.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .