4
Ich entwickle ein Spiel mit libgdx für Android und ios. Ich habe bereits Screenshot mit dieser Funktion erhalten,Wie Screenshot von libgdx Spielpunktzahl in WhatsApp und Facebook teilen?
public void take() {
byte[] pixels = ScreenUtils.getFrameBufferPixels(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true);
Pixmap pixmap = new Pixmap(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Pixmap.Format.RGBA8888);
BufferUtils.copy(pixels, 0, pixmap.getPixels(), pixels.length);
PixmapIO.writePNG(Gdx.files.external("mypixmap.png"), pixmap);
pixmap.dispose();
}
Wie kann ich Screenshot in facebook und whatsapp erhalten teilen?
Danke.Ich denke, dass dieser Code speziell für Android ist. Ich brauche einen Code für libgdx (plattformunabhängig), der sowohl in android als auch in ios funktioniert. – Aju
Das ist nicht möglich. Android und iOS handhaben Absichten unterschiedlich. Sie müssen etwas wie ein [Interface] implementieren (http://stackoverflow.com/questions/39536189/google-sign-in-with-libgdx/39540760#39540760). – Marius