さて、私はちょうどそれで出てきます。私はAndroidのコーディングには全く新しいです。私はまた、私の電話でAIDEとだけそれをやっています。gdxのゲームで別のクラスを開く方法
私は私のコードをポストするかどうかはわかりませんが、ここに行く
aboutgame.javaラベルされた別のクラスを開きたいです。
package com.bernco.screenoff;
import com.badlogic.gdx.*;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g2d.*;
import com.badlogic.gdx.scenes.scene2d.*;
import com.badlogic.gdx.scenes.scene2d.ui.*;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle;
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton;
public class MyGdxGame implements ApplicationListener
{
Texture texture;
Texture pwrdby;
Texture about;
SpriteBatch batch;
SpriteBatch pwrbtch;
SpriteBatch abtbtch;
@Override
public void create()
{
texture = new Texture(Gdx.files.internal("dark-android.jpg"));
about = new Texture(Gdx.files.internal("about.png"));
pwrdby = new Texture(Gdx.files.internal("powered-by.png"));
batch = new SpriteBatch();
abtbtch = new SpriteBatch();
pwrbtch = new SpriteBatch();
}
@Override
public void render()
{
Gdx.gl.glClearColor(0f, 0f, 0f, 0f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
abtbtch.begin();
abtbtch.draw(about, Gdx.graphics.getWidth() - about.getWidth()/2, Gdx.graphics.getHeight() - about.getHeight()/2,
Gdx.graphics.getWidth()/8, Gdx.graphics.getWidth()/8);
abtbtch.end();
batch.begin();
batch.draw(texture, Gdx.graphics.getWidth()/80, 0,
Gdx.graphics.getWidth()/1, Gdx.graphics.getWidth()/2);
batch.end();
pwrbtch.begin();
pwrbtch.draw(pwrdby, Gdx.graphics.getWidth()/80, 0,
Gdx.graphics.getWidth()/4, Gdx.graphics.getWidth()/3);
pwrbtch.end();
}
@Override
public void dispose()
{
}
@Override
public void resize(int width, int height)
{
}
@Override
public void pause()
{
}
@Override
public void resume()
{
}
}
提案:良いLibGDX _book_に投資し、ステップバイステップの例に従ってください。個人的には、「LibGDXでゲーム開発を始めよう」と本当に楽しんでいます。 – DavidS