@Override public FileHandleResolver newResolver (FileType fileType) { switch (fileType) { case Absolute: return new AbsoluteFileHandleResolver(); case Classpath: return new ClasspathFileHandleResolver(); case External: return new ExternalFileHandleResolver(); case Internal: return new InternalFileHandleResolver(); case Local: return new LocalFileHandleResolver(); } return null; // Should never happen }
private void loadAsync() { Thread th = new Thread(new Runnable() { @Override public void run() { if (thumbnail) createThumb(); final TextureLoader tl = new TextureLoader(new AbsoluteFileHandleResolver()); try { tl.loadAsync(assetManager, ImgName, Gdx.files.absolute(mPath), null); Gdx.app.postRunnable(new Runnable() { @Override public void run() { // Log.info(log, "LoadSync " + mPath + ":" + ImgName); mImageTex = tl.loadSync(assetManager, ImgName, Gdx.files.absolute(mPath), null); Sprite sprite = new Sprite(mImageTex); spriteWidth = sprite.getWidth(); spriteHeight = sprite.getHeight(); setSprite(sprite, reziseHeight); // Log.info(log, "LoadSync " + mPath + ":" + ImgName + " ready"); } }); } catch (Exception e) { //e.printStackTrace(); } } }); th.start(); }
@Before public void before() throws IOException { HeadlessGdx.init(); testSuite = JngTestSuite.open(); assetManager = new AssetManager(new AbsoluteFileHandleResolver()); JngTextureLoader.register(assetManager); }