You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to display a .tmx map that I did with Tiled Map Editor. I want to display it inside a layout (Android Mobile Application), however I didn't find any tips or tutoriel about how to do it, and I have absolutely no ideas. I did all the references to AndEngine, and my environement is correctly setup.
I just need a link or infos about how to do that.
I tried this simple piece of code :
publicclassYourActivityextendsSimpleBaseGameActivity {
privateTMXTiledMaptiledMap;
privateTMXLayertmxLayer;
@OverrideprotectedvoidonCreateResources() {
try {
finalTMXLoadertmxLoader = newTMXLoader(getAssets(), getTextureManager(), TextureOptions.NEAREST, getVertexBufferObjectManager(), newITMXTilePropertiesListener() {
@OverridepublicvoidonTMXTileWithPropertiesCreated(finalTMXTiledMaptmxTiledMap, finalTMXLayertmxLayer, finalTMXTiletmxTile, finalTMXProperties<TMXTileProperty> tmxTileProperties) {
// do stuff with tiles that have properties...
}
});
this.tiledMap = tmxLoader.loadFromAsset("tmx/yourMap.tmx");
this.tiledMap.setIsometricDrawMethod(TMXIsometricConstants.DRAW_METHOD_ISOMETRIC_CULLING_PADDING);
} catch (finalTMXLoadExceptione) {
Debug.e(e);
}
}
@OverrideprotectedSceneonCreateScene() {
this.tmxLayer = this.tiledMap.getTMXLayers().get(0); // the 0 is just an index of the layer. It depends on how many layers you created within TiledattachChild(this.tmxLayer);
}
But I got many errors concerning this line new TMXLoader(... so maybe it's deprecated...
If you have any ideas, I would be very grateful !
Thank's for your help !
The text was updated successfully, but these errors were encountered:
I'm trying to display a .tmx map that I did with Tiled Map Editor. I want to display it inside a layout (Android Mobile Application), however I didn't find any tips or tutoriel about how to do it, and I have absolutely no ideas. I did all the references to AndEngine, and my environement is correctly setup.
I just need a link or infos about how to do that.
I tried this simple piece of code :
But I got many errors concerning this line
new TMXLoader(...
so maybe it's deprecated...If you have any ideas, I would be very grateful !
Thank's for your help !
The text was updated successfully, but these errors were encountered: