Cross platform maps with LibGDX and VTM

107 views
Skip to first unread message

Lóránt Viktor Gerber

unread,
Mar 13, 2017, 11:51:47 AM3/13/17
to mapsforge-dev
How can I make use of VTM in my cross-platform LibGDX game? It sould run on Android and Desktop, and I only want to write map code once.

Longri, Andre Höpfner

unread,
Mar 13, 2017, 12:41:09 PM3/13/17
to mapsfo...@googlegroups.com
Create a LibGdx project!

At core you can render your map like

try {
    mMapRenderer.onDrawFrame();
} catch (Exception e) {
    e.printStackTrace();
}

If you want use the LibGdx GUI, like Stage, so you must reset the OpenGL settings from MapRenderer before you can call 

try {
    StageManager.draw();
} catch (Exception e) {
    log.error("Draw StageManager", e);
}

A full LibGdx project, used this, can you find on Github

2017-03-13 16:51 GMT+01:00 Lóránt Viktor Gerber <glor...@gmail.com>:
How can I make use of VTM in my cross-platform LibGDX game? It sould run on Android and Desktop, and I only want to write map code once.

--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mapsfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mapsforge-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/4b2cbf89-9a69-4090-be81-3067a1ae6d60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Emux

unread,
Mar 13, 2017, 1:24:39 PM3/13/17
to mapsfo...@googlegroups.com
VTM on Desktop works with libGDX via LWJGL backend.

And on Android (besides pure implementation) can also use libGDX Android backend.

You can check Desktop vtm-playground and Android vtm-android-gdx for running samples per platform.

--
Emux
Reply all
Reply to author
Forward
0 new messages