- 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
FieldsModifier and TypeFieldDescriptionstatic TextureRenderer<Object>A debugging texture renderer that prints out the data toSystem.out. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TextureRenderer<T>compose(TextureRenderer<? super T>... renderers)Composes multiple texture renderers into one.default voiddraw(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.voidDraws rectangular region of a texture.default voiddraw(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
-
STDOUT_DEBUG
A debugging texture renderer that prints out the data toSystem.out.
-
-
Method Details
-
compose
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:ContextualTextureRendererDraws rectangular region of a texture.- Specified by:
drawin interfaceContextualTextureRenderer<T,@Nullable Void>- Parameters:
texture- the texturecontext- the context needed to draw the texturex- the leftmost X coordinate of the target drawing regiony- the topmost Y coordinate of the target drawing regionwidth- the width of the target regionheight- the height of the target regionu1- the left edge of the input region as a fraction from 0 to 1v1- the top edge of the input region as a fraction from 0 to 1u2- the right edge of the input region as a fraction from 0 to 1v2- the bottom edge of the input region as a fraction from 0 to 1
-
draw
Draws rectangular region of a texture.- Parameters:
texture- the texturex- the leftmost X coordinate of the target drawing regiony- the topmost Y coordinate of the target drawing regionwidth- the width of the target regionheight- the height of the target regionu1- the left edge of the input region as a fraction from 0 to 1v1- the top edge of the input region as a fraction from 0 to 1u2- the right edge of the input region as a fraction from 0 to 1v2- 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 regionx- the leftmost X coordinate of the target drawing regiony- the topmost Y coordinate of the target drawing regionwidth- the width of the target regionheight- the height of the target regionu1- the left edge of the input region as a fraction from 0 to 1v1- the top edge of the input region as a fraction from 0 to 1u2- the right edge of the input region as a fraction from 0 to 1v2- the bottom edge of the input region as a fraction from 0 to 1
-