/** Returns a copy of the specified drawable. */ public Drawable newDrawable (Drawable drawable) { if (drawable instanceof TiledDrawable) return new TiledDrawable((TiledDrawable)drawable); if (drawable instanceof TextureRegionDrawable) return new TextureRegionDrawable((TextureRegionDrawable)drawable); if (drawable instanceof NinePatchDrawable) return new NinePatchDrawable((NinePatchDrawable)drawable); if (drawable instanceof SpriteDrawable) return new SpriteDrawable((SpriteDrawable)drawable); throw new GdxRuntimeException("Unable to copy, unknown drawable type: " + drawable.getClass()); }
/** Returns a copy of the specified drawable. */ public Drawable newDrawable (Drawable drawable) { if (drawable instanceof TiledDrawable) return new TiledDrawable((TiledDrawable)drawable); if (drawable instanceof TextureRegionDrawable) return new TextureRegionDrawable((TextureRegionDrawable)drawable); if (drawable instanceof NinePatchDrawable) return new NinePatchDrawable((NinePatchDrawable)drawable); if (drawable instanceof SpriteDrawable) return new SpriteDrawable((SpriteDrawable)drawable); throw new GdxRuntimeException("Unable to copy, unknown drawable type: " + drawable.getClass()); }
/** 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. */ public TiledDrawable getTiledDrawable (String name) { TiledDrawable tiled = optional(name, TiledDrawable.class); if (tiled != null) return tiled; tiled = new TiledDrawable(getRegion(name)); tiled.setName(name); add(name, tiled, TiledDrawable.class); return tiled; }
/** 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. */ public TiledDrawable getTiledDrawable (String name) { TiledDrawable tiled = optional(name, TiledDrawable.class); if (tiled != null) return tiled; tiled = new TiledDrawable(getRegion(name)); tiled.setName(name); add(name, tiled, TiledDrawable.class); return tiled; }
public TiledDrawable tint (Color tint) { TiledDrawable drawable = new TiledDrawable(this); drawable.color.set(tint); drawable.setLeftWidth(getLeftWidth()); drawable.setRightWidth(getRightWidth()); drawable.setTopHeight(getTopHeight()); drawable.setBottomHeight(getBottomHeight()); return drawable; } }
public TiledDrawable tint (Color tint) { TiledDrawable drawable = new TiledDrawable(this); drawable.color.set(tint); drawable.setLeftWidth(getLeftWidth()); drawable.setRightWidth(getRightWidth()); drawable.setTopHeight(getTopHeight()); drawable.setBottomHeight(getBottomHeight()); return drawable; } }
public BusyBar(Style style) { this.style = style; patternDrawable = new TiledDrawable((TextureRegionDrawable) style.pattern); }
patch = new TiledDrawable(skin.getRegion("default-round"));
private void loadTiledDrawables() { if(patches[TOP_CENTER] != null) { topCenter = new TiledDrawable(patches[TOP_CENTER]); } if(patches[MIDDLE_LEFT] != null) { middleLeft = new TiledDrawable(patches[MIDDLE_LEFT]); } if(patches[MIDDLE_CENTER] != null) { middleCenter = new TiledDrawable(patches[MIDDLE_CENTER]); } if(patches[MIDDLE_RIGHT] != null) { middleRight = new TiledDrawable(patches[MIDDLE_RIGHT]); } if(patches[BOTTOM_CENTER] != null) { bottomCenter = new TiledDrawable(patches[BOTTOM_CENTER]); } }
/** Returns a copy of the specified drawable. */ public Drawable newDrawable (Drawable drawable) { if (drawable instanceof TiledDrawable) return new TiledDrawable((TiledDrawable)drawable); if (drawable instanceof TextureRegionDrawable) return new TextureRegionDrawable((TextureRegionDrawable)drawable); if (drawable instanceof NinePatchDrawable) return new NinePatchDrawable((NinePatchDrawable)drawable); if (drawable instanceof SpriteDrawable) return new SpriteDrawable((SpriteDrawable)drawable); throw new GdxRuntimeException("Unable to copy, unknown drawable type: " + drawable.getClass()); }
/** 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. */ public TiledDrawable getTiledDrawable (String name) { TiledDrawable tiled = optional(name, TiledDrawable.class); if (tiled != null) return tiled; tiled = new TiledDrawable(getRegion(name)); tiled.setName(name); add(name, tiled, TiledDrawable.class); return tiled; }
public ControlsWindow(String title, Skin skin, Stage ui) { super(title, skin); this.setName(title); this.skin = skin; this.ui = ui; /** Global resources **/ TextureRegion septexreg = ((TextureRegionDrawable) skin.newDrawable("separator")).getRegion(); septexreg.getTexture().setWrap(TextureWrap.Repeat, TextureWrap.ClampToEdge); this.separator = new TiledDrawable(septexreg); EventManager.instance.subscribe(this, Events.TOGGLE_TIME_CMD, Events.GUI_SCROLL_POSITION_CMD, Events.GUI_FOLD_CMD, Events.GUI_MOVE_CMD, Events.RECALCULATE_OPTIONS_SIZE); }
public TiledDrawable tint (Color tint) { TiledDrawable drawable = new TiledDrawable(this); drawable.color.set(tint); drawable.setLeftWidth(getLeftWidth()); drawable.setRightWidth(getRightWidth()); drawable.setTopHeight(getTopHeight()); drawable.setBottomHeight(getBottomHeight()); return drawable; } }
tile = new TiledDrawable(Ctx.assetManager.getIcon("transparent-light")); background = skin.getDrawable("background");