/** * Get the <code>TextureAtlasTile</code> for the given Texture * @param texture The texture to retrieve the <code>TextureAtlasTile</code> for. * @return the atlas tile */ public TextureAtlasTile getAtlasTile(Texture texture) { String sourceTextureName = textureName(texture); if (sourceTextureName != null) { return getAtlasTile(sourceTextureName); } return null; }
/** * Add a texture for a specific map name at the location of another existing texture on the master map. * @param texture A texture to add to the atlas. * @param mapName A freely chosen map name that can be later retrieved as a Texture. * @param masterTexture The master texture for determining the location, it has to exist in tha master map. */ public void addTexture(Texture texture, String mapName, Texture masterTexture) { String sourceTextureName = textureName(masterTexture); if (sourceTextureName == null) { throw new IllegalStateException("Supplied master map texture has no asset key name!"); } else { addTexture(texture, mapName, sourceTextureName); } }
/** * Add a texture for a specific map name at the location of another existing texture (on the master map). * @param texture A texture to add to the atlas. * @param mapName A freely chosen map name that can be later retrieved as a Texture. * @param sourceTextureName Name of the master map used for the location. */ public void addTexture(Texture texture, String mapName, String sourceTextureName) { if (texture == null) { throw new IllegalStateException("Texture cannot be null!"); } String name = textureName(texture); if (texture.getImage() != null && name != null) { addImage(texture.getImage(), name, mapName, sourceTextureName); } else { throw new IllegalStateException("Texture has no asset key name!"); } }
/** * Add a texture for a specific map name * @param texture A texture to add to the atlas. * @param mapName A freely chosen map name that can be later retrieved as a Texture. The first map name supplied will be the master map. * @return false if the atlas is full. */ public boolean addTexture(Texture texture, String mapName) { if (texture == null) { throw new IllegalStateException("Texture cannot be null!"); } String name = textureName(texture); if (texture.getImage() != null && name != null) { return addImage(texture.getImage(), name, mapName, null); } else { throw new IllegalStateException("Texture has no asset key name!"); } }
/** * Get the <code>TextureAtlasTile</code> for the given Texture * @param texture The texture to retrieve the <code>TextureAtlasTile</code> for. * @return the atlas tile */ public TextureAtlasTile getAtlasTile(Texture texture) { String sourceTextureName = textureName(texture); if (sourceTextureName != null) { return getAtlasTile(sourceTextureName); } return null; }
/** * Add a texture for a specific map name at the location of another existing texture on the master map. * @param texture A texture to add to the atlas. * @param mapName A freely chosen map name that can be later retrieved as a Texture. * @param masterTexture The master texture for determining the location, it has to exist in tha master map. */ public void addTexture(Texture texture, String mapName, Texture masterTexture) { String sourceTextureName = textureName(masterTexture); if (sourceTextureName == null) { throw new IllegalStateException("Supplied master map texture has no asset key name!"); } else { addTexture(texture, mapName, sourceTextureName); } }
/** * Add a texture for a specific map name * @param texture A texture to add to the atlas. * @param mapName A freely chosen map name that can be later retrieved as a Texture. The first map name supplied will be the master map. * @return false if the atlas is full. */ public boolean addTexture(Texture texture, String mapName) { if (texture == null) { throw new IllegalStateException("Texture cannot be null!"); } String name = textureName(texture); if (texture.getImage() != null && name != null) { return addImage(texture.getImage(), name, mapName, null); } else { throw new IllegalStateException("Texture has no asset key name!"); } }
/** * Add a texture for a specific map name at the location of another existing texture (on the master map). * @param texture A texture to add to the atlas. * @param mapName A freely chosen map name that can be later retrieved as a Texture. * @param sourceTextureName Name of the master map used for the location. */ public void addTexture(Texture texture, String mapName, String sourceTextureName) { if (texture == null) { throw new IllegalStateException("Texture cannot be null!"); } String name = textureName(texture); if (texture.getImage() != null && name != null) { addImage(texture.getImage(), name, mapName, sourceTextureName); } else { throw new IllegalStateException("Texture has no asset key name!"); } }