Class JFXMediaLoader

java.lang.Object
nl.colorize.multimedialib.renderer.java2d.StandardMediaLoader
nl.colorize.multimedialib.renderer.jfx.JFXMediaLoader
All Implemented Interfaces:
MediaLoader

public class JFXMediaLoader extends StandardMediaLoader
Media implementation for JavaFX. Everything related to graphics uses a JavaFX-specific implementation that does not rely on AWT, Java2D, or Swing. Everything not related to graphics is delegated to the Java2D renderer.
  • Constructor Details

    • JFXMediaLoader

      public JFXMediaLoader()
  • Method Details

    • loadImage

      public JFXImage loadImage(nl.colorize.util.ResourceFile file)
      Description copied from interface: MediaLoader
      Loads an image from a file. Images in JPEG and PNG format are supported by all renderers.
      Specified by:
      loadImage in interface MediaLoader
      Overrides:
      loadImage in class StandardMediaLoader
    • loadAudio

      public Audio loadAudio(nl.colorize.util.ResourceFile file)
      Description copied from interface: MediaLoader
      Loads an audio clip from a file. MP3 files are supported by all renderers.
      Specified by:
      loadAudio in interface MediaLoader
      Overrides:
      loadAudio in class StandardMediaLoader
    • loadFont

      public FontFace loadFont(nl.colorize.util.ResourceFile file, String family, int size, ColorRGB color)
      Description copied from interface: MediaLoader
      Loads a TrueType or FreeType font so the renderer can use that font for text rendering. This will return a font for the specified style, alternative styles can be derived from the returned font.
      Specified by:
      loadFont in interface MediaLoader
      Overrides:
      loadFont in class StandardMediaLoader
    • getFont

      protected javafx.scene.text.Font getFont(FontFace key)