why when I try to open my game screen in libgdx from android from an activity I get a black screen as an output?

0

Class that opens from another class "AndroidLauncher extends AndroidAplication" from which this class "screen" is launched.

public class Mgame  implements ApplicationListener {

private SpriteBatch batch;
private Texture font;

@Override
public void create() {
    batch=new SpriteBatch();
    font=new Texture(Gdx.files.internal("badlogic.jpg"));


}

@Override
public void resize(int width, int height) {

}

@Override
public void render() {
    Gdx.gl.glClearColor(10, 15, 0, 1);
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

    batch.begin();
    batch.draw(font,200,200);
    batch.end();

}

@Override
public void pause() {

}

@Override
public void resume() {

}

@Override
public void dispose() {

}
}

The screen (1) is the initial activity, by pressing the button this directs us to the AndroidLaucher class that is responsible for launching the previous class generating the screen (2) as output. I do not know why it does not work for me, the texture should be painted, but it does not happen.

I get the following error:

  

07-29 14: 43: 35.522 11616-11616 / com.example.diannaliset.game2   E / dalvikvm: Could not find class   'android.graphics.drawable.RippleDrawable', referenced from method   android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering   07-29 14: 43: 41.670 11616-11896 / com.example.diannaliset.game2 A / libc:   Fatal signal 11 (SIGSEGV) at 0x0000000d (code = 1), thread 11896   (Thread-3232)

    
asked by Oskar Ivan Scr 29.07.2018 в 21:44
source

1 answer

0

The mistake I was making was that I was generating an Android project for which I then added the libgdx libraries that I thought were enough to generate my games, which It is not like this. What you have to do, and most of you will already know, you must create the project using jar libjdx link , this is responsible for generating all the necessary environment to work without doing it ourselves.

    
answered by 06.08.2018 в 17:21