Class TeaMediaLoader

  • All Implemented Interfaces:
    MediaLoader

    public class TeaMediaLoader
    extends java.lang.Object
    implements MediaLoader
    Delegates media loading to the browser. Images, audio, and fonts are loaded using the conventional browser APIs. Text files are embedded into the HTML during the build, and can therefore be loaded immediately.
    • Constructor Detail

      • TeaMediaLoader

        public TeaMediaLoader​(GraphicsMode graphicsMode)
    • Method Detail

      • checkLoadingProgress

        public boolean checkLoadingProgress()
        Checks the loading status of all resources, and returns true if all previously requested resources have completed loading.In JavaScript all operations that involve loading resources from files are done asynchronously, but managing a scene that is partially loaded would be extremely inconvenient, so this method can be used to suspend the scene until loading has been completed.
      • 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
      • loadFont

        public TTFont loadFont​(FilePointer file,
                               java.lang.String family,
                               int size,
                               ColorRGB color,
                               boolean bold)
        Description copied from interface: MediaLoader
        Loads a TrueType font from a .ttf file and converts it to a format that can be used by the renderer.
        Specified by:
        loadFont in interface MediaLoader
      • loadMesh

        public PolygonMesh loadMesh​(FilePointer file)
        Description copied from interface: MediaLoader
        Loads a polygon mesh from the specified file. Only the FBX file format is supported by all renderer implementations.
        Specified by:
        loadMesh in interface MediaLoader
      • loadText

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