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

Unable to find region from badlogic #15

Open
murchie85 opened this issue Feb 3, 2017 · 2 comments
Open

Unable to find region from badlogic #15

murchie85 opened this issue Feb 3, 2017 · 2 comments

Comments

@murchie85
Copy link

In the code snippet below, it says incompatible types for region where i have marked asterisk, for some reason it only recognises it as java.lang.object.

public TextureRegion getFrame(float dt){
currentState = getState();

    TextureRegion region;
    switch(currentState){
        case JUMPING:
            region = marioJump.getKeyFrame(stateTimer);  ***********
            break;
        case RUNNING:
            region = marioRun.getKeyFrame(stateTimer, true); ***********
            break;
        case FALLING:
        case STANDING:
        default:
            region = marioStand;
            break;
    }
@creative04
Copy link

Did you find a solution about this problem?
I wondered too.
Can you share with me if you find it?

@RobCM
Copy link

RobCM commented Apr 6, 2017

Make sure that the region in use is from "import com.badlogic.gdx.graphics.g2d.TextureRegion;" and not import com.badlogic.gdx.graphics.Texture;
Also the variables are set as:
private Animation marioRun;
private Animation growMario;

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

No branches or pull requests

3 participants