Class GDXMediaLoader

  • All Implemented Interfaces:
    MediaLoader

    public class GDXMediaLoader
    extends java.lang.Object
    implements MediaLoader
    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 Detail

      • GDXMediaLoader

        public GDXMediaLoader()
    • Method Detail

      • loadImage

        public Image loadImage​(FilePointer file)
        Description copied from interface: MediaLoader
        Loads 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:
        loadImage in interface MediaLoader
      • loadAudio

        public Audio loadAudio​(FilePointer file)
        Description copied from interface: MediaLoader
        Loads 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:
        loadAudio in interface MediaLoader
      • getColorTexture

        public com.badlogic.gdx.graphics.Texture getColorTexture​(ColorRGB color)
      • loadFont

        public TTFont loadFont​(java.lang.String fontFamily,
                               FilePointer file)
        Description copied from interface: MediaLoader
        Loads a TrueType font from a .ttf file.
        Specified by:
        loadFont in interface MediaLoader
        Parameters:
        fontFamily - The logical name of the font family that is being loaded.
      • loadText

        public java.lang.String loadText​(FilePointer file)
        Description copied from interface: MediaLoader
        Loads a text-based resource file using UTF-8 encoding. T
        Specified by:
        loadText in interface MediaLoader
      • dispose

        public void dispose()