java - Libgdx MainMenuScreen -
i trying learn use libgdx engine. tutorial (https://code.google.com/p/libgdx/wiki/extendedsimpleapp) on website of libgdx describes, tried set little main menu. have imported classes needed, @ line 29 there error: "mainmenuscreen can not resolved type". here source code:
package com.me.mygdxgame; import java.awt.splashscreen; import com.badlogic.gdx.applicationlistener; import com.badlogic.gdx.game; import com.badlogic.gdx.gdx; import com.badlogic.gdx.graphics.gl10; import com.badlogic.gdx.graphics.orthographiccamera; import com.badlogic.gdx.graphics.texture; import com.badlogic.gdx.graphics.g2d.bitmapfont; import com.badlogic.gdx.graphics.g2d.sprite; import com.badlogic.gdx.graphics.g2d.spritebatch; public class mygdxgame implements applicationlistener { private orthographiccamera camera; private spritebatch batch; private texture texture; private sprite sprite; private bitmapfont font; @override public void create() { batch = new spritebatch(); //use libgdx's default arial font. font = new bitmapfont(); this.setscreen(new mainmenuscreen(this)); } @override public void dispose() { batch.dispose(); texture.dispose(); } @override public void render() { gdx.gl.glclearcolor(1, 1, 1, 1); gdx.gl.glclear(gl10.gl_color_buffer_bit); batch.setprojectionmatrix(camera.combined); batch.begin(); sprite.draw(batch); batch.end(); } @override public void resize(int width, int height) { } @override public void pause() { } @override public void resume() { }
}
mainmenuscreen not standard-class, if read further in tutorial have linked see created additional class "mainmenuscreen", create class named "mainmenuscreen" , add code tutorial there.
if first time java might want google java tutorials learn fundementals of java , oop first before use external libraries ;)
Comments
Post a Comment