\r
/** Returns a copy of a drawable found in the skin via {@link #getDrawable(String)}. */\r
public Drawable newDrawable (String name) {\r
- Drawable drawable = getDrawable(name);\r
+ return newDrawable(getDrawable(name));\r
+ }\r
+\r
+ /** Returns a tinted copy of a drawable found in the skin via {@link #getDrawable(String)}. */\r
+ public Drawable newDrawable (String name, float r, float g, float b, float a) {\r
+ return newDrawable(getDrawable(name), new Color(r, g, b, a));\r
+ }\r
+\r
+ /** Returns a tinted copy of a drawable found in the skin via {@link #getDrawable(String)}. */\r
+ public Drawable newDrawable (String name, Color tint) {\r
+ return newDrawable(getDrawable(name), tint);\r
+ }\r
+\r
+ /** Returns a copy of the specified drawable. */\r
+ public Drawable newDrawable (Drawable drawable) {\r
if (drawable instanceof TextureRegionDrawable) return new TextureRegionDrawable((TextureRegionDrawable)drawable);\r
if (drawable instanceof NinePatchDrawable) return new NinePatchDrawable((NinePatchDrawable)drawable);\r
if (drawable instanceof SpriteDrawable) return new SpriteDrawable((SpriteDrawable)drawable);\r
}\r
\r
/** Returns a tinted copy of a drawable found in the skin via {@link #getDrawable(String)}. */\r
- public Drawable newDrawable (String name, float r, float g, float b, float a) {\r
- return newDrawable(name, new Color(r, g, b, a));\r
+ public Drawable newDrawable (Drawable drawable, float r, float g, float b, float a) {\r
+ return newDrawable(drawable, new Color(r, g, b, a));\r
}\r
\r
/** Returns a tinted copy of a drawable found in the skin via {@link #getDrawable(String)}. */\r
- public Drawable newDrawable (String name, Color tint) {\r
- Drawable drawable = getDrawable(name);\r
+ public Drawable newDrawable (Drawable drawable, Color tint) {\r
if (drawable instanceof TextureRegionDrawable) {\r
Sprite sprite = new Sprite(((TextureRegionDrawable)drawable).getRegion());\r
sprite.setColor(tint);\r