Package com.badlogic.gdx.scenes.scene2d.utils

Examples of com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable


        if (region.splits != null)
          drawable = new NinePatchDrawable(getPatch(name));
        else if (region.rotate || region.packedWidth != region.originalWidth || region.packedHeight != region.originalHeight)
          drawable = new SpriteDrawable(getSprite(name));
      }
      if (drawable == null) drawable = new TextureRegionDrawable(textureRegion);
    } catch (GdxRuntimeException ignored) {
    }

    // Check for explicit registration of ninepatch, sprite, or tiled drawable.
    if (drawable == null) {
View Full Code Here


    return newDrawable(getDrawable(name), tint);
  }

  /** Returns a copy of the specified drawable. */
  public Drawable newDrawable (Drawable 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());
  }
View Full Code Here

  }

  /** Creates an image stretched, and aligned center.
   * @param region May be null. */
  public Image (TextureRegion region) {
    this(new TextureRegionDrawable(region), Scaling.stretch, Align.center);
  }
View Full Code Here

    this(new TextureRegionDrawable(region), Scaling.stretch, Align.center);
  }

  /** Creates an image stretched, and aligned center. */
  public Image (Texture texture) {
    this(new TextureRegionDrawable(new TextureRegion(texture)));
  }
View Full Code Here

        //construct the actual marker
        if (marker.getText() != null && marker.getImage() != null) {
            ImageTextButton.ImageTextButtonStyle style =
                    new ImageTextButton.ImageTextButtonStyle();
            style.imageUp = new TextureRegionDrawable(
                    marker.getImage().getTextureRegion());
            style.font = marker.getFont();

            actor = new ImageTextButton(marker.getText(), style);
        } else if (marker.getText() != null) {
            Label.LabelStyle style = new Label.LabelStyle();
            style.font = marker.getFont();

            actor = new Label(marker.getText(), style);
        } else if (marker.getImage() != null) {
            actor = new ImageButton(
                    new TextureRegionDrawable(
                    marker.getImage().getTextureRegion()));
        }

        if (actor != null) {
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.