Examples of TMXMapReader


Examples of tiled.io.TMXMapReader

            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

Examples of tiled.io.TMXMapReader

        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

Examples of tiled.io.TMXMapReader

      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
Copyright © 2018 www.massapi.com. 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.