/** Creates a new empty drawable with the same sizing information as the specified drawable. */ public BaseDrawable (Drawable drawable) { if (drawable instanceof BaseDrawable) name = ((BaseDrawable)drawable).getName(); leftWidth = drawable.getLeftWidth(); rightWidth = drawable.getRightWidth(); topHeight = drawable.getTopHeight(); bottomHeight = drawable.getBottomHeight(); minWidth = drawable.getMinWidth(); minHeight = drawable.getMinHeight(); }
public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getTopHeight(); } };
public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getLeftWidth(); } };
/** 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()); }
/** Creates an image stretched, and aligned center. * @param region May be null. */ public Image (TextureRegion region) { this(new TextureRegionDrawable(region), Scaling.stretch, Align.center); }
public float getMinWidth () { float first = firstWidget instanceof Layout ? ((Layout)firstWidget).getMinWidth() : 0; float second = secondWidget instanceof Layout ? ((Layout)secondWidget).getMinWidth() : 0; if (vertical) return Math.max(first, second); return first + style.handle.getMinWidth() + second; }
public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getRightWidth(); } };
public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getBottomHeight(); } };
/** Creates an image stretched, and aligned center. * @param patch May be null. */ public Image (NinePatch patch) { this(new NinePatchDrawable(patch), Scaling.stretch, Align.center); }
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { if (pressed) return false; if (pointer == 0 && this.button != -1 && button != this.button) return false; pressed = true; pressedPointer = pointer; pressedButton = button; touchDownX = x; touchDownY = y; setVisualPressed(true); return true; }
/** Creates a new empty drawable with the same sizing information as the specified drawable. */ public BaseDrawable (Drawable drawable) { if (drawable instanceof BaseDrawable) name = ((BaseDrawable)drawable).getName(); leftWidth = drawable.getLeftWidth(); rightWidth = drawable.getRightWidth(); topHeight = drawable.getTopHeight(); bottomHeight = drawable.getBottomHeight(); minWidth = drawable.getMinWidth(); minHeight = drawable.getMinHeight(); }
/** 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()); }
/** Creates an image stretched, and aligned center. * @param region May be null. */ public Image (TextureRegion region) { this(new TextureRegionDrawable(region), Scaling.stretch, Align.center); }
public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getTopHeight(); } };
public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getLeftWidth(); } };
public float get (Actor context) { Drawable background = ((Table)context).background; return background == null ? 0 : background.getRightWidth(); } };
/** Creates an image stretched, and aligned center. * @param patch May be null. */ public Image (NinePatch patch) { this(new NinePatchDrawable(patch), Scaling.stretch, Align.center); }
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { if (pressed) return false; if (pointer == 0 && this.button != -1 && button != this.button) return false; pressed = true; pressedPointer = pointer; pressedButton = button; touchDownX = x; touchDownY = y; setVisualPressed(true); return true; }