写真を見せたいのですが、入力を待って(つまりタッチ)、写真の位置で確認してください。バッチは私の入力に対してアラートを維持する必要があります。しかし、どこで比較しなければならないのか、写真の入力と位置がわかりません。または、タッチ入力を取得するための遅延を作成するために、待機をどのように使用する必要があるか。たとえば、私はこのコードを使用します。しかし、それは黒い画面を表示するだけです...
public void render() {
x = rand.nextFloat() * 1024;
y = rand.nextFloat() * 700;
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(texture, x, y);
if (Gdx.input.justTouched()) {
if (Gdx.input.getX() > x && Gdx.input.getX() < texture.getWidth() + x) {
if (Gdx.input.getY() > y && Gdx.input.getY() < texture.getHeight() + y) {
batch.end();
}
}
}
}
または、showpicでwaitforcreatedelayを使用します。
public void render() {
x = rand.nextFloat() * 1024;
y = rand.nextFloat() * 700;
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(texture, x, y);
try {
batch.wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
batch.end();
}
私はちょうどgdxとandroidを始めます。私の悪い言葉でごめんなさい。