diff --git a/hyperlap2d-runtime-libgdx b/hyperlap2d-runtime-libgdx index bf2ead82..c2591075 160000 --- a/hyperlap2d-runtime-libgdx +++ b/hyperlap2d-runtime-libgdx @@ -1 +1 @@ -Subproject commit bf2ead820d6d1cdbe8b33f23fa7c201bf4c54735 +Subproject commit c259107565cc16b18ee4c10c034fc6fe959217a1 diff --git a/src/main/java/games/rednblack/editor/proxy/ResourceManager.java b/src/main/java/games/rednblack/editor/proxy/ResourceManager.java index d24ababe..633281be 100644 --- a/src/main/java/games/rednblack/editor/proxy/ResourceManager.java +++ b/src/main/java/games/rednblack/editor/proxy/ResourceManager.java @@ -254,8 +254,12 @@ public class ResourceManager extends Proxy implements IResourceRetriever { String filename = file.getName(); if (file.isDirectory() || filename.endsWith(".DS_Store")) continue; - BitmapFont bitmapFont = new BitmapFont(Gdx.files.internal(file.getAbsolutePath()), getTextureRegion(entry.nameWithoutExtension())); - bitmapFont.setUseIntegerPositions(false); + Array pages = new Array<>(); + BitmapFont.BitmapFontData bitmapFontData = new BitmapFont.BitmapFontData(Gdx.files.internal(file.getAbsolutePath()), false); + for (String page : bitmapFontData.imagePaths) { + pages.add(getTextureRegion(FilenameUtils.getBaseName(page))); + } + BitmapFont bitmapFont = new BitmapFont(bitmapFontData, pages, false); bitmapFonts.put(bitmapFont.getData().name, bitmapFont); } } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/BitmapFontAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/BitmapFontAsset.java index f1d6cb62..ae9e730b 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/BitmapFontAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/BitmapFontAsset.java @@ -14,6 +14,7 @@ import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.ProgressHandler; import games.rednblack.h2d.common.vo.ExportMapperVO; import org.apache.commons.io.FileUtils; +import org.apache.commons.io.FilenameUtils; import java.io.File; import java.io.IOException; @@ -100,7 +101,7 @@ public class BitmapFontAsset extends Asset { exportMapperVO.mapper.add(new ExportMapperVO.ExportedAsset(AssetsUtils.TYPE_BITMAP_FONT, fileSrc.getName())); BitmapFont.BitmapFontData bitmapFontData = new BitmapFont.BitmapFontData(new FileHandle(fileSrc), false); for (String textureName : bitmapFontData.imagePaths) { - File f = new File(currentProjectPath + ProjectManager.IMAGE_DIR_PATH + File.separator + textureName); + File f = new File(currentProjectPath + ProjectManager.IMAGE_DIR_PATH + File.separator + FilenameUtils.getName(textureName)); FileUtils.copyFileToDirectory(f, tmpDir); } return true;