Skip to content

TMXLoader v0.2

Pre-release
Pre-release

Choose a tag to compare

@jmecn jmecn released this 15 Dec 10:57
· 198 commits to master since this release

Changelog

  • Use Bucket.GUI instead of Bucket.Transparent, change whole scene from XOZ plane to XOY plane now.
  • Removed RPGCameraState, use only TiledMapAppState now.
  • Fixed issue #1 and #2: Removed BatchNode, use simple Node instead.
  • Fixed issue #3: Now tiles with flip mask can display correctly.
  • Add new feature for animated tiles.

animatedtile

TODO

  • Fixed issue #4
  • Add interface to let control tiles and objects in the scene.

How to use:

package net.jmecn.tmx;

import com.jme3.app.SimpleApplication;
import com.jme3.tmx.TiledMapAppState;
import com.jme3.tmx.TmxLoader;
import com.jme3.tmx.core.TiledMap;

/**
 * Test loading tmx assets with TmxLoader.
 * @author yanmaoyuan
 *
 */
public class TmxLoaderExample extends SimpleApplication {

    @Override
    public void simpleInitApp() {
        // register it
        assetManager.registerLoader(TmxLoader.class, "tmx", "tsx");

        // load tmx with it
        TiledMap map = (TiledMap) assetManager.loadAsset("Models/Examples/Desert/desert.tmx");
        assert map != null;

        // render it with TiledMapAppState
        stateManager.attach(new TiledMapAppState());

        TiledMapAppState tiledMap = stateManager.getState(TiledMapAppState.class);
        tiledMap.setMap(map);
    }

    public static void main(String[] args) {
        TmxLoaderExample app = new TmxLoaderExample();
        app.start();
    }

}