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

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


  }

  /** 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;

    Drawable drawable = optional(name, Drawable.class);
    if (drawable != null) {
      if (!(drawable instanceof TiledDrawable)) {
        throw new GdxRuntimeException("Drawable found but is not a TiledDrawable: " + name + ", "
          + drawable.getClass().getName());
      }
      return (TiledDrawable)drawable;
    }

    tiled = new TiledDrawable(getRegion(name));
    add(name, tiled, TiledDrawable.class);
    return tiled;
  }
View Full Code Here

TOP

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

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.