Class TeaMediaLoader
- java.lang.Object
-
- nl.colorize.multimedialib.renderer.teavm.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 Summary
Constructors Constructor Description TeaMediaLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsResourceFile(FilePointer file)booleanisImageLoadingComplete()Returns true once all requested images have been loaded by the browser.AudioloadAudio(FilePointer file)Loads an audio clip from a file.TTFontloadFont(java.lang.String fontFamily, FilePointer file)Loads a TrueType font from a.ttffile.ImageloadImage(FilePointer file)Loads an image from a file.java.lang.StringloadText(FilePointer file)Loads a text-based resource file using UTF-8 encoding.-
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
loadBitmapFont, loadDefaultFont, 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
-
isImageLoadingComplete
public boolean isImageLoadingComplete()
Returns true once all requested images have been loaded by the browser. The browser loads images asynchronously, so even though the image elements may already exist, this doesn't necessarily mean that the image content can actually be displayed.
-
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
-
loadFont
public TTFont loadFont(java.lang.String fontFamily, FilePointer file)
Description copied from interface:MediaLoaderLoads a TrueType font from a.ttffile.- Specified by:
loadFontin interfaceMediaLoader- 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:MediaLoaderLoads a text-based resource file using UTF-8 encoding.- Specified by:
loadTextin interfaceMediaLoader
-
containsResourceFile
public boolean containsResourceFile(FilePointer file)
- Specified by:
containsResourceFilein interfaceMediaLoader
-
-