Class NinePatch.Builder<T>

java.lang.Object
juuxel.libninepatch.NinePatch.Builder<T>
Type Parameters:
T - the texture type
Enclosing class:
NinePatch<T>

public static final class NinePatch.Builder<T> extends Object
A builder for NinePatch.
See Also:
NinePatch.builder(Object), NinePatch.builder(TextureRegion)
  • Method Details

    • cornerSize

      public NinePatch.Builder<T> cornerSize​(int width, int height)
      Sets the corner size of the rendered rectangle.
      Parameters:
      width - the corner width
      height - the corner height
      Returns:
      this builder
    • cornerSize

      public NinePatch.Builder<T> cornerSize​(int size)
      Sets the corner size of the rendered rectangle.
      Parameters:
      size - the corner width and height
      Returns:
      this builder
    • cornerUv

      public NinePatch.Builder<T> cornerUv​(float u, float v)
      Sets the corner UV sizes in the texture.
      Parameters:
      u - the width of the corner in the texture as a fraction from 0 to 1
      v - the height of the corner in the texture as a fraction from 0 to 1
      Returns:
      this builder
    • cornerUv

      public NinePatch.Builder<T> cornerUv​(float uv)
      Sets the corner UV size in the texture.
      Parameters:
      uv - the width and height of the corner in the texture as a fraction from 0 to 1
      Returns:
      this builder
    • tileSize

      public NinePatch.Builder<T> tileSize​(int width, int height)
      Sets the tile size of the rendered texture when the mode is NinePatch.Mode.TILING.
      Parameters:
      width - the tile width
      height - the tile height
      Returns:
      this builder
    • tileSize

      public NinePatch.Builder<T> tileSize​(int size)
      Sets the tile size of the rendered texture when the mode is NinePatch.Mode.TILING.
      Parameters:
      size - the tile width and height
      Returns:
      this builder
    • mode

      public NinePatch.Builder<T> mode​(NinePatch.Mode mode)
      Sets the rendering mode of this builder.
      Parameters:
      mode - the new rendering mode
      Returns:
      this builder
    • build

      public NinePatch<T> build()
      Creates a new NinePatch from this builder.
      Returns:
      the created nine-patch renderer