Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Texture


      }
    }
  }

  static public void enableDebugging (String debugTextureFile) {
    debugTexture = new Texture(Gdx.files.internal(debugTextureFile), false);
    debug = true;
  }
View Full Code Here


    data = new SkinData();
  }

  public Skin (FileHandle skinFile, FileHandle textureFile) {
    data = new SkinData();
    data.texture = new Texture(textureFile);
    try {
      getJsonLoader(skinFile).fromJson(Skin.class, skinFile);
    } catch (SerializationException ex) {
      throw new SerializationException("Error reading file: " + skinFile, ex);
    }
View Full Code Here

  /** Creates a BitmapFont from a BMFont file, using the specified image for glyphs. Any image specified in the BMFont file is
   * ignored.
   * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner.
   * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts.s */
  public BitmapFont (FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) {
    this(new BitmapFontData(fontFile, flip), new TextureRegion(new Texture(imageFile, false)), integer);
  }
View Full Code Here

  public BitmapFont (FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) {
    this(new BitmapFontData(fontFile, flip), new TextureRegion(new Texture(imageFile, false)), integer);
  }

  public BitmapFont (BitmapFontData data, TextureRegion region, boolean integer) {
    this.region = region == null ? new TextureRegion(new Texture(Gdx.files.internal(data.imagePath), false)) : region;
    this.flipped = data.flipped;
    this.integer = integer;
    this.data = data;
    load(data);
  }
View Full Code Here

   * @return The bounds of the rendered string (the height is the distance from y to the baseline). Note the same TextBounds
   *         instance is used for all methods that return TextBounds. */
  public TextBounds draw (SpriteBatch spriteBatch, CharSequence str, float x, float y, int start, int end) {
    float batchColor = spriteBatch.color;
    spriteBatch.setColor(color);
    final Texture texture = region.getTexture();
    y += data.ascent;
    float startX = x;
    Glyph lastGlyph = null;
    if (data.scaleX == 1 && data.scaleY == 1) {
      if (integer) {
View Full Code Here

  /** Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height. */
  public void draw (TextureRegion region, float x, float y, float width, float height) {
    if (!drawing) throw new IllegalStateException("SpriteBatch.begin must be called before draw.");

    Texture texture = region.texture;
    if (texture != lastTexture) {
      renderMesh();
      lastTexture = texture;
      invTexWidth = 1f / texture.getWidth();
      invTexHeight = 1f / texture.getHeight();
    } else if (idx == vertices.length) //
      renderMesh();

    final float fx2 = x + width;
    final float fy2 = y + height;
View Full Code Here

   * originX, originY. */
  public void draw (TextureRegion region, float x, float y, float originX, float originY, float width, float height,
    float scaleX, float scaleY, float rotation) {
    if (!drawing) throw new IllegalStateException("SpriteBatch.begin must be called before draw.");

    Texture texture = region.texture;
    if (texture != lastTexture) {
      renderMesh();
      lastTexture = texture;
      invTexWidth = 1f / texture.getWidth();
      invTexHeight = 1f / texture.getHeight();
    } else if (idx == vertices.length) //
      renderMesh();

    // bottom left and top right corner points relative to origin
    final float worldOriginX = x + originX;
View Full Code Here

   * originX, originY. */
  public void draw (TextureRegion region, float x, float y, float originX, float originY, float width, float height,
    float scaleX, float scaleY, float rotation, boolean clockwise) {
    if (!drawing) throw new IllegalStateException("SpriteBatch.begin must be called before draw.");

    Texture texture = region.texture;
    if (texture != lastTexture) {
      renderMesh();
      lastTexture = texture;
      invTexWidth = 1f / texture.getWidth();
      invTexHeight = 1f / texture.getHeight();
    } else if (idx == vertices.length) //
      renderMesh();

    // bottom left and top right corner points relative to origin
    final float worldOriginX = x + originX;
View Full Code Here

 
 
  public static GameObject createObject(int width, int heigth, int j, int i, Vector2 initialPosition){
    GameObject gameObject = new GameObject("Objeto");
   
    Texture tx = Cactus2DApplication.loadTexture("data/textures/allTextures.png", true);
    SpriteRendererComponent sr = SpriteRendererComponent.getTextureRegion(tx,width, heigth, j, i);

    gameObject.AddComponent(sr);

    Utils.offsetCorrection(initialPosition);
View Full Code Here

  }

  public static GameObject createBackground() {
    GameObject gameObject = new GameObject("background");
   
    Texture tx = Cactus2DApplication.loadTexture("data/textures/allTextures.png", true);
    SpriteRendererComponent sr = SpriteRendererComponent.getTextureRegion(tx,600, 1024, 0, 0);
    gameObject.AddComponent(sr);
    Utils.offsetCorrection(gameObject.transform.getLocalPosition());
    return gameObject;
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.Texture

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.