Class BrowserDOM

java.lang.Object
nl.colorize.multimedialib.renderer.teavm.BrowserDOM

public class BrowserDOM extends Object
Provides access to the browser's DOM contents. This is always available to the TeaVM renderer, regardless of which graphics library is used.

Note this class is different from Browser, which can be used to access the browser's native JavaScript API. The reason these are two separate classes is purely because TeaVM does not allow "native" implementations and Java implementations to be mixed within the same class.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.teavm.jso.dom.html.HTMLCanvasElement
    applyMask(TeaImage image, ColorRGB mask)
    Creates an alternative version of the image with the specified mask color applied to every non-transparent pixel.
    org.teavm.jso.dom.html.HTMLCanvasElement
    createColorCanvas(int width, int height, ColorRGB color)
     
    org.teavm.jso.dom.html.HTMLCanvasElement
    createFullScreenCanvas(org.teavm.jso.dom.html.HTMLElement container)
     
    static nl.colorize.util.http.PostData
    Parses the current URL's query string visible in the browser, and returns the result as a PostData instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BrowserDOM

      public BrowserDOM()
  • Method Details

    • createFullScreenCanvas

      public org.teavm.jso.dom.html.HTMLCanvasElement createFullScreenCanvas(org.teavm.jso.dom.html.HTMLElement container)
    • applyMask

      public org.teavm.jso.dom.html.HTMLCanvasElement applyMask(TeaImage image, ColorRGB mask)
      Creates an alternative version of the image with the specified mask color applied to every non-transparent pixel. This is a relatively heavy operation, so masked images are cached to avoid having to create them every single frame.
    • createColorCanvas

      public org.teavm.jso.dom.html.HTMLCanvasElement createColorCanvas(int width, int height, ColorRGB color)
    • getQueryString

      public static nl.colorize.util.http.PostData getQueryString()
      Parses the current URL's query string visible in the browser, and returns the result as a PostData instance.