BrentAureli/SuperMario

no suitable method found for setRegion(Object)

Opened this issue · 5 comments

Hi guys, I keep getting the same problem over again anytime i use the getframe i.e. setRegion(walkAnimation.getKeyFrame(stateTime, true));
Getting this long error..
Error:(33, 8) Gradle: error: no suitable method found for setRegion(Object)
method TextureRegion.setRegion(Texture) is not applicable
(argument mismatch; Object cannot be converted to Texture)
method TextureRegion.setRegion(TextureRegion) is not applicable
(argument mismatch; Object cannot be converted to TextureRegion)
Any ideas?

Sorry for the delay, have you found a solution for your problem?

If not, could you link to the file you're working in?

Hi,
No worries, I have tried recoding from scratch - before I got there I noticed an issue with the new Animation(0.4f, frames). My latest cut of the code is here dude https://github.com/murchie85/smario
any help much appreciated.

I was looking at the code for differences between your and Brent's Mario.java.
Why do you use getTexture? (I'm not sure what getTexture returns here)

Yours

marioStand = new TextureRegion(getTexture(), 0,0, 16,16);

Brent's

marioStand = new TextureRegion(screen.getAtlas().findRegion("little_mario"), 0, 0, 16, 16);

Hey I got the same problem. let me know how u fixed it