Giter VIP home page Giter VIP logo

Comments (3)

digital-thinking avatar digital-thinking commented on May 25, 2024

ScreenManager extends FadingGame {
public ScreenManager() {
super(new SpriteBatch());
}
}

This works for me. Can u post your stacktrace?

from libgdx-transitions.

eliasbrange avatar eliasbrange commented on May 25, 2024

Same problem here. Main class looks like this:

public class Template extends FadingGame {

    public ActionResolver actionResolver;

    public Template(ActionResolver actionResolver) {
        super(new SpriteBatch());
        this.actionResolver = actionResolver;
    }

    @Override
    public void create () {
    ...
    }        

Stacktrace:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xxx.template, PID: 3430
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.template/com.xxx.template.AndroidLauncher}: java.lang.NullPointerException: Attempt to invoke interface method 'int com.badlogic.gdx.Graphics.getWidth()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3254)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
at android.app.ActivityThread.access$1100(ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int com.badlogic.gdx.Graphics.getWidth()' on a null object reference
at com.badlogic.gdx.graphics.g2d.SpriteBatch.(SpriteBatch.java:105)
at com.badlogic.gdx.graphics.g2d.SpriteBatch.(SpriteBatch.java:78)
at com.xxx.template.Template.(Template.java:0)
at com.xxx.template.AndroidLauncher.onCreate(AndroidLauncher.java:48)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350) 
at android.app.ActivityThread.access$1100(ActivityThread.java:222) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:158) 
at android.app.ActivityThread.main(ActivityThread.java:7229) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 

from libgdx-transitions.

digital-thinking avatar digital-thinking commented on May 25, 2024

Not sure if the actual version of libgdx changed some things and if the lib is still working for that version.
Sorry, but i don´t have the time to look after that, if you find the problem it would be great if you submit a pull request. Thanks.

from libgdx-transitions.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.