Package tiled.io

Examples of tiled.io.TMXMapReader$MapEntityResolver


            return;
        }

        Map map;
        try {
            TMXMapReader mapReader = new TMXMapReader();
            map = mapReader.readMap(fileToOpen);
        } catch (Exception e) {
            System.out.println("Error while reading the map:\n" + e.getMessage());
            return;
        }
View Full Code Here


        loadMapFromPath(path);
        setBasePathFrom(path.toFile());
      } else if (input instanceof FileEditorInput) {
        IFile file = ResourceUtil.getFile(input);
        IPath path = file.getLocation();
        currentMap = new TMXMapReader().readMap(
            ((FileEditorInput) input).getFile().getContents(),
            path.toFile());
        setBasePathFrom(path.toFile());
      } else if (input instanceof IURIEditorInput) {
        URI uri = ((IURIEditorInput) input).getURI();
        File mapFile = new File(uri);
        currentMap = new TMXMapReader().readMap(
            new ByteArrayInputStream(document.get().getBytes()),mapFile);
      } else
        IFile file = ResourceUtil.getFile(input);
        if (file != null) {
          IPath path = file.getLocation();
          currentMap = new TMXMapReader().readMap(
              ((FileEditorInput) input).getFile().getContents(),
              path.toFile());
        } else {
          currentMap = new TMXMapReader()
              .readMap(new ByteArrayInputStream(document.get()
                  .getBytes()));
        }
      }
      IActionBars actionBars = getEditorSite().getActionBars();
View Full Code Here

      basePath = file.getParent();
  }

  protected void loadMapFromPath(IPath path) throws Exception {
    System.out.println(path.toOSString());
    currentMap = new TMXMapReader().readMap(
        new ByteArrayInputStream(document.get().getBytes()),
        path.toFile());
  }
View Full Code Here

TOP

Related Classes of tiled.io.TMXMapReader$MapEntityResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.