Class GDXMediaLoader
- java.lang.Object
-
- nl.colorize.multimedialib.renderer.libgdx.GDXMediaLoader
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,MediaLoader
public class GDXMediaLoader extends java.lang.Object implements MediaLoader, com.badlogic.gdx.utils.Disposable
Loads media assets using the libGDX framework.libGDX requires an explicit dispose step to close all loaded media files and release the associated resources. This can be done globally for all media files by calling
dispose().
-
-
Constructor Summary
Constructors Constructor Description GDXMediaLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsResourceFile(FilePointer file)Returns whether the specified resource file is available.voiddispose()protected com.badlogic.gdx.graphics.g2d.BitmapFontgetBitmapFont(TTFont font)com.badlogic.gdx.graphics.TexturegetColorTexture(ColorRGB color)protected com.badlogic.gdx.graphics.g3d.ModelgetModelData(PolygonMesh mesh)AudioloadAudio(FilePointer file)Loads an audio clip from a file.TTFontloadFont(FilePointer file, java.lang.String family, int size, ColorRGB color, boolean bold)Loads a TrueType font from a.ttffile and converts it to a format that can be used by the renderer.ImageloadImage(FilePointer file)Loads an image from a file.PolygonMeshloadMesh(FilePointer file)Loads a polygon mesh from the specified file.java.lang.StringloadText(FilePointer file)Loads a text-based resource file using UTF-8 encoding.protected PolygonMeshregisterMesh(java.lang.String name, com.badlogic.gdx.graphics.g3d.Model modelData)com.badlogic.gdx.graphics.ColortoColor(ColorRGB color)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nl.colorize.multimedialib.renderer.MediaLoader
loadDefaultFont, loadFont, loadSpriteSheetCSV, loadTextLines
-
-
-
-
Method Detail
-
loadImage
public Image loadImage(FilePointer file)
Description copied from interface:MediaLoaderLoads an image from a file. JPEG and PNG images are guaranteed to be supported, though other image formats may also be supported depending on the platform.- Specified by:
loadImagein interfaceMediaLoader
-
loadAudio
public Audio loadAudio(FilePointer file)
Description copied from interface:MediaLoaderLoads an audio clip from a file. OGG and MP3 files are guaranteed to be supported, though other audio formats may be also be supported depending on the platform.- Specified by:
loadAudioin interfaceMediaLoader
-
getColorTexture
public com.badlogic.gdx.graphics.Texture getColorTexture(ColorRGB color)
-
loadFont
public TTFont loadFont(FilePointer file, java.lang.String family, int size, ColorRGB color, boolean bold)
Description copied from interface:MediaLoaderLoads a TrueType font from a.ttffile and converts it to a format that can be used by the renderer.- Specified by:
loadFontin interfaceMediaLoader
-
getBitmapFont
protected com.badlogic.gdx.graphics.g2d.BitmapFont getBitmapFont(TTFont font)
-
loadText
public java.lang.String loadText(FilePointer file)
Description copied from interface:MediaLoaderLoads a text-based resource file using UTF-8 encoding.- Specified by:
loadTextin interfaceMediaLoader
-
loadMesh
public PolygonMesh loadMesh(FilePointer file)
Description copied from interface:MediaLoaderLoads a polygon mesh from the specified file. Only the FBX file format is supported by all renderer implementations.- Specified by:
loadMeshin interfaceMediaLoader
-
registerMesh
protected PolygonMesh registerMesh(java.lang.String name, com.badlogic.gdx.graphics.g3d.Model modelData)
-
getModelData
protected com.badlogic.gdx.graphics.g3d.Model getModelData(PolygonMesh mesh)
-
containsResourceFile
public boolean containsResourceFile(FilePointer file)
Description copied from interface:MediaLoaderReturns whether the specified resource file is available.- Specified by:
containsResourceFilein interfaceMediaLoader
-
toColor
public com.badlogic.gdx.graphics.Color toColor(ColorRGB color)
-
dispose
public void dispose()
- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
-