Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextArea ColorMarkup ArrayIndexOutOfBoundsException #3992

Closed
1 of 6 tasks
keeyzar opened this issue Apr 6, 2016 · 3 comments
Closed
1 of 6 tasks

TextArea ColorMarkup ArrayIndexOutOfBoundsException #3992

keeyzar opened this issue Apr 6, 2016 · 3 comments
Labels

Comments

@keeyzar
Copy link

keeyzar commented Apr 6, 2016

Issue details

At some sizes the Textarea with enabled Color Markup throws an ArrayOutOfBoundsException

Reproduction steps/code

public class test extends Game {
    Stage stage;

    @Override
    public void render() {
        stage.act();
        stage.draw();
    }

    @Override
    public void create() {

        Skin skin = assetManager.get(AssetVariables.UI_SKIN_JSON, Skin.class); //I guess any Skin will do
        stage = new Stage();
        TextArea textArea = new TextArea("", skin);
        textArea.getStyle().font.getData().markupEnabled = true;
        textArea.setText("[RED] nice text [] i like");
        textArea.setFillParent(true);
        textArea.setPosition(0, 100);
        textArea.setSize(200, 100);
        stage.addActor(textArea);

    }
}

Version of LibGDX and/or relevant dependencies

1.9.2 (the latest)

Stacktrace

Exception in thread "LWJGL Application" java.lang.ArrayIndexOutOfBoundsException: 16
    at com.badlogic.gdx.scenes.scene2d.ui.TextField.calculateOffsets(TextField.java:244)
    at com.badlogic.gdx.scenes.scene2d.ui.TextArea.calculateOffsets(TextArea.java:263)
    at com.badlogic.gdx.scenes.scene2d.ui.TextField.draw(TextField.java:294)
    at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:110)
    at com.badlogic.gdx.scenes.scene2d.Group.draw(Group.java:57)
    at com.badlogic.gdx.scenes.scene2d.Stage.draw(Stage.java:128)
    at de.keeyzar.earthragequit.testingPurpose.test.render(test.java:21)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:223)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124)

Please select the affected platforms

  • Android
  • iOS
  • HTML/GWT
  • Windows
  • Linux
  • MacOS
@davebaol davebaol added scene2d need more info needs more info. Likely to be closed when no reaction given. and removed need more info needs more info. Likely to be closed when no reaction given. labels Apr 6, 2016
@MobiDevelop
Copy link
Member

Previous discussion on use of markup in TextField/TextArea: #2645

@Wulf
Copy link

Wulf commented Oct 11, 2016

Same, on Desktop / Linux.

Exception in thread "LWJGL Application" java.lang.ArrayIndexOutOfBoundsException: 16
    at com.badlogic.gdx.scenes.scene2d.ui.TextField.calculateOffsets(TextField.java:261)
    at com.badlogic.gdx.scenes.scene2d.ui.TextArea.calculateOffsets(TextArea.java:263)
    at com.badlogic.gdx.scenes.scene2d.ui.TextField.draw(TextField.java:310)
    at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:110)
    at com.badlogic.gdx.scenes.scene2d.ui.Table.draw(Table.java:110)
    at com.badlogic.gdx.scenes.scene2d.ui.Window.draw(Window.java:243)
    at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:110)
    at com.badlogic.gdx.scenes.scene2d.Group.draw(Group.java:57)
    at com.badlogic.gdx.scenes.scene2d.Stage.draw(Stage.java:128)
    at test.game.render(TestGame.java:217)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:223)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124)

@badlogic
Copy link
Member

badlogic commented Dec 4, 2016

Conclusion of previous discussion: markup on textfields/areas is not supported. Happy to merge PRs, closing this out otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants