See the documentation for more.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv TextureAtlas | |
| private static final Class | |
| private final ObjectMap | |
| pack-priv IdentityMap | |
| pack-priv float |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Skin(FileHandle skinFile, TextureAtlas atlas)
Creates a skin containing the resources in the specified skin JSON file and the texture regions from the specified atlas. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | dispose()
Implements com. Disposes the |
| public String | |
| private static Method | |
| public <T> T | |
| public <T> T | |
| public <T> ObjectMap | |
| public TextureAtlas | |
| public Color | |
| public Drawable | |
| public BitmapFont | |
| public ObjectMap | |
| protected Json | |
| public NinePatch | |
| public TextureRegion | |
| public Array | getRegions(String regionName)
Returns: an array with the |
| public Sprite | |
| public TiledDrawable | |
| public boolean | |
| public void | |
| public Drawable | |
| public Drawable | newDrawable(String name, float r, float g, float b, float a)
Returns a tinted copy of a drawable found in the skin via |
| public Drawable | newDrawable(String name, Color tint)
Returns a tinted copy of a drawable found in the skin via |
| public Drawable | |
| public Drawable | newDrawable(Drawable drawable, float r, float g, float b, float a)
Returns a tinted copy of a drawable found in the skin via |
| public Drawable | newDrawable(Drawable drawable, Color tint)
Returns a tinted copy of a drawable found in the skin via |
| public <T> T | |
| public void | |
| public void | scale(Drawable drawble)
Scales the drawable's |
| public <V> void | setEnabled(Styleable<V> styleable, boolean enabled)
Sets the style on the actor to disabled or enabled. |
| public void | setEnabledReflection(Actor actor, boolean enabled)
Deprecated
Sets the style on the actor to disabled or enabled. |
| public void |
| atlas | back to summary |
|---|---|
| pack-priv TextureAtlas atlas | |
| defaultTagClasses | back to summary |
|---|---|
| private static final Class<T>[] defaultTagClasses | |
| jsonClassTags | back to summary |
|---|---|
| private final ObjectMap<String, Class<T>> jsonClassTags | |
| resources | back to summary |
|---|---|
| pack-priv IdentityMap<Class<T>, ObjectMap<String, Object>> resources | |
| scale | back to summary |
|---|---|
| pack-priv float scale | |
| Skin | back to summary |
|---|---|
| public Skin() Creates an empty skin. | |
| Skin | back to summary |
|---|---|
| public Skin(FileHandle skinFile) Creates a skin containing the resources in the specified skin JSON file. If a file in the same directory with a ".atlas"
extension exists, it is loaded as a | |
| Skin | back to summary |
|---|---|
| public Skin(FileHandle skinFile, TextureAtlas atlas) Creates a skin containing the resources in the specified skin JSON file and the texture regions from the specified atlas. The atlas is automatically disposed when the skin is disposed. | |
| Skin | back to summary |
|---|---|
| public Skin(TextureAtlas atlas) Creates a skin containing the texture regions from the specified atlas. The atlas is automatically disposed when the skin is disposed. | |
| add | back to summary |
|---|---|
| public void add(String name, Object resource) | |
| add | back to summary |
|---|---|
| public void add(String name, Object resource, Class<T> type) | |
| addRegions | back to summary |
|---|---|
| public void addRegions(TextureAtlas atlas) Adds all named texture regions from the atlas. The atlas will not be automatically disposed when the skin is disposed. | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements com. Disposes the | |
| find | back to summary |
|---|---|
| public String find(Object resource) Returns the name of the specified style object, or null if it is not in the skin. This compares potentially every style object in the skin of the same type as the specified style, which may be a somewhat expensive operation.
| |
| findMethod | back to summary |
|---|---|
private static Method findMethod(Class<T> type, String name)
| |
| get | back to summary |
|---|---|
| public <T> T get(Class<T> type) Returns a resource named "default" for the specified type.
| |
| get | back to summary |
|---|---|
| public <T> T get(String name, Class<T> type) Returns a named resource of the specified type.
| |
| getAll | back to summary |
|---|---|
| public <T> ObjectMap Returns the name to resource mapping for the specified type, or null if no resources of that type exist.
| |
| getAtlas | back to summary |
|---|---|
| public TextureAtlas getAtlas() Returns the
| |
| getColor | back to summary |
|---|---|
| public Color getColor(String name) | |
| getDrawable | back to summary |
|---|---|
| public Drawable getDrawable(String name) Returns a registered drawable. If no drawable is found but a region, ninepatch, or sprite exists with the name, then the appropriate drawable is created and stored in the skin. | |
| getFont | back to summary |
|---|---|
| public BitmapFont getFont(String name) | |
| getJsonClassTags | back to summary |
|---|---|
| public ObjectMap Returns a map of | |
| getJsonLoader | back to summary |
|---|---|
| protected Json getJsonLoader(final FileHandle skinFile) | |
| getPatch | back to summary |
|---|---|
| public NinePatch getPatch(String name) Returns a registered ninepatch. If no ninepatch is found but a region exists with the name, a ninepatch is created from the
region and stored in the skin. If the region is an | |
| getRegion | back to summary |
|---|---|
| public TextureRegion getRegion(String name) Returns a registered texture region. If no region is found but a texture exists with the name, a region is created from the texture and stored in the skin. | |
| getRegions | back to summary |
|---|---|
public Array
| |
| getSprite | back to summary |
|---|---|
| public Sprite getSprite(String name) Returns a registered sprite. If no sprite is found but a region exists with the name, a sprite is created from the region
and stored in the skin. If the region is an | |
| getTiledDrawable | back to summary |
|---|---|
| public TiledDrawable getTiledDrawable(String name) Returns a registered tiled drawable. If no tiled drawable is found but a region exists with the name, a tiled drawable is created from the region and stored in the skin. | |
| has | back to summary |
|---|---|
| public boolean has(String name, Class<T> type) | |
| load | back to summary |
|---|---|
| public void load(FileHandle skinFile) Adds all resources in the specified skin JSON file. | |
| newDrawable | back to summary |
|---|---|
| public Drawable newDrawable(String name) Returns a copy of a drawable found in the skin via | |
| newDrawable | back to summary |
|---|---|
| public Drawable newDrawable(String name, float r, float g, float b, float a) Returns a tinted copy of a drawable found in the skin via | |
| newDrawable | back to summary |
|---|---|
| public Drawable newDrawable(String name, Color tint) Returns a tinted copy of a drawable found in the skin via | |
| newDrawable | back to summary |
|---|---|
| public Drawable newDrawable(Drawable drawable) Returns a copy of the specified drawable. | |
| newDrawable | back to summary |
|---|---|
| public Drawable newDrawable(Drawable drawable, float r, float g, float b, float a) Returns a tinted copy of a drawable found in the skin via | |
| newDrawable | back to summary |
|---|---|
| public Drawable newDrawable(Drawable drawable, Color tint) Returns a tinted copy of a drawable found in the skin via | |
| optional | back to summary |
|---|---|
| public <T> T optional(String name, Class<T> type) Returns a named resource of the specified type.
| |
| remove | back to summary |
|---|---|
| public void remove(String name, Class<T> type) | |
| scale | back to summary |
|---|---|
| public void scale(Drawable drawble) Scales the drawable's | |
| setEnabled | back to summary |
|---|---|
| public <V> void setEnabled(Styleable<V> styleable, boolean enabled) Sets the style on the actor to disabled or enabled. This is done by appending "-disabled" to the style name when enabled is false, and removing "-disabled" from the style name when enabled is true. If the style was not found in the skin, an exception is thrown. | |
| setEnabledReflection | back to summary |
|---|---|
| public void setEnabledReflection(Actor actor, boolean enabled)
Deprecated
Sets the style on the actor to disabled or enabled. This is done by appending "-disabled" to the style name when enabled is false, and removing "-disabled" from the style name when enabled is true. A method named "getStyle" is called the actor via reflection and the name of that style is found in the skin. If the actor doesn't have a "getStyle" and "setStyle" method the actor is left unchanged. If the style was not found in the skin, an exception is thrown.
| |
| setScale | back to summary |
|---|---|
| public void setScale(float scale) The scale used to size drawables created by this skin. This can be useful when scaling an entire UI (eg with a stage's viewport) then using an atlas with images whose resolution matches the UI scale. The skin can then be scaled the opposite amount so that the larger or smaller images are drawn at the original size. For example, if the UI is scaled 2x, the atlas would have images that are twice the size, then the skin's scale would be set to 0.5. | |
| Access | Constructor and Description |
|---|---|
| public |
| TintedDrawable | back to summary |
|---|---|
| public TintedDrawable() | |