Interface TextureRenderer<T>

Type Parameters:
T - the texture type that this renderer can draw
All Superinterfaces:
ContextualTextureRenderer<T,​@Nullable Void>
All Known Implementing Classes:
AwtTextureRenderer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TextureRenderer<T> extends ContextualTextureRenderer<T,​@Nullable Void>
Texture renderers are used for drawing platform-specific textures and texture regions.

TextureRenderer is a special variant of ContextualTextureRenderer that does not need a context object. You should pass null as the context object.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    A debugging texture renderer that prints out the data to System.out.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> TextureRenderer<T>
    compose​(TextureRenderer<? super T>... renderers)
    Composes multiple texture renderers into one.
    default void
    draw​(TextureRegion<? extends T> region, int x, int y, int width, int height, float u1, float v1, float u2, float v2)
    Draws rectangular subregion of a texture region.
    void
    draw​(T texture, int x, int y, int width, int height, float u1, float v1, float u2, float v2)
    Draws rectangular region of a texture.
    default void
    draw​(T texture, @Nullable Void context, int x, int y, int width, int height, float u1, float v1, float u2, float v2)
    Draws rectangular region of a texture.

    Methods inherited from interface juuxel.libninepatch.ContextualTextureRenderer

    draw, drawTiled, drawTiled
  • Field Details

  • Method Details

    • compose

      @SafeVarargs static <T> TextureRenderer<T> compose​(TextureRenderer<? super T>... renderers)
      Composes multiple texture renderers into one.
      Type Parameters:
      T - the texture type that the resulting renderer will accept
      Parameters:
      renderers - the renderers
      Returns:
      the combined renderer
    • draw

      default void draw​(T texture, @Nullable @Nullable Void context, int x, int y, int width, int height, float u1, float v1, float u2, float v2)
      Description copied from interface: ContextualTextureRenderer
      Draws rectangular region of a texture.
      Specified by:
      draw in interface ContextualTextureRenderer<T,​@Nullable Void>
      Parameters:
      texture - the texture
      context - the context needed to draw the texture
      x - the leftmost X coordinate of the target drawing region
      y - the topmost Y coordinate of the target drawing region
      width - the width of the target region
      height - the height of the target region
      u1 - the left edge of the input region as a fraction from 0 to 1
      v1 - the top edge of the input region as a fraction from 0 to 1
      u2 - the right edge of the input region as a fraction from 0 to 1
      v2 - the bottom edge of the input region as a fraction from 0 to 1
    • draw

      void draw​(T texture, int x, int y, int width, int height, float u1, float v1, float u2, float v2)
      Draws rectangular region of a texture.
      Parameters:
      texture - the texture
      x - the leftmost X coordinate of the target drawing region
      y - the topmost Y coordinate of the target drawing region
      width - the width of the target region
      height - the height of the target region
      u1 - the left edge of the input region as a fraction from 0 to 1
      v1 - the top edge of the input region as a fraction from 0 to 1
      u2 - the right edge of the input region as a fraction from 0 to 1
      v2 - the bottom edge of the input region as a fraction from 0 to 1
    • draw

      default void draw​(TextureRegion<? extends T> region, int x, int y, int width, int height, float u1, float v1, float u2, float v2)
      Draws rectangular subregion of a texture region.
      Parameters:
      region - the texture region
      x - the leftmost X coordinate of the target drawing region
      y - the topmost Y coordinate of the target drawing region
      width - the width of the target region
      height - the height of the target region
      u1 - the left edge of the input region as a fraction from 0 to 1
      v1 - the top edge of the input region as a fraction from 0 to 1
      u2 - the right edge of the input region as a fraction from 0 to 1
      v2 - the bottom edge of the input region as a fraction from 0 to 1