我正在尝试学习使用libgdx框架.与libgdx网站上的教程(https://code.google.com/p/libgdx/wiki/ExtendedSimpleApp)一样,我尝试设置一个小主菜单.我已导入所有需要的类,但在第29行始终存在错误:"MainMenuScreen无法解析为类型".这是源代码:
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() { …Run Code Online (Sandbox Code Playgroud)