java.lang.Object
juuxel.libninepatch.NinePatch<T>
- Type Parameters:
T- the texture type
A nine-patch renderer.
New NinePatch instances are creating using NinePatch.Builder.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder forNinePatch.static classThe rendering mode of a nine-patch renderer. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> NinePatch.Builder<T>builder(TextureRegion<T> texture)Creates aNinePatch.Builderusing a texture region.static <T> NinePatch.Builder<T>builder(T texture)Creates aNinePatch.Builderusing a full texture.<C> voiddraw(ContextualTextureRenderer<? super T,C> renderer, C context, int width, int height)Draws a nine-patch region using a contextual texture renderer.voiddraw(TextureRenderer<? super T> renderer, int width, int height)Draws a nine-patch region using a non-contextual texture renderer.
-
Method Details
-
draw
public <C> void draw(ContextualTextureRenderer<? super T,C> renderer, C context, int width, int height)Draws a nine-patch region using a contextual texture renderer.- Type Parameters:
C- the type of context that is needed to draw a texture- Parameters:
renderer- the renderer for drawing the texturecontext- the context used for drawing the texturewidth- the width of the target regionheight- the height of the target region
-
draw
Draws a nine-patch region using a non-contextual texture renderer.- Parameters:
renderer- the renderer for drawing the texturewidth- the width of the target regionheight- the height of the target region
-
builder
Creates aNinePatch.Builderusing a full texture.- Type Parameters:
T- the texture type- Parameters:
texture- the texture- Returns:
- a nine-patch renderer builder using the texture
-
builder
Creates aNinePatch.Builderusing a texture region.- Type Parameters:
T- the texture type- Parameters:
texture- the texture region- Returns:
- a nine-patch renderer builder using the texture region
- Throws:
NullPointerException- if the texture region is null
-