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

Examples of com.badlogic.gdx.scenes.scene2d.utils.Drawable.draw()


    float textY = textBounds.height / 2 + font.getDescent();

    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    float bgLeftWidth = 0;
    if (background != null) {
      background.draw(batch, x, y, width, height);
      bgLeftWidth = background.getLeftWidth();
      float bottom = background.getBottomHeight();
      textY = (int)(textY + (height - background.getTopHeight() - bottom) / 2 + bottom);
    } else
      textY = (int)(textY + height / 2);
View Full Code Here


      if (node.children.size == 0) continue;

      Drawable expandIcon = node.expanded ? minus : plus;
      float iconY = actor.getY() + Math.round((node.height - expandIcon.getMinHeight()) / 2);
      expandIcon.draw(batch, x + indent - iconSpacingLeft, y + iconY, expandIcon.getMinWidth(), expandIcon.getMinHeight());
      if (node.expanded) draw(batch, node.children, indent + indentSpacing);
    }
  }

  /** @return May be null. */
 
View Full Code Here

    float y = getY();
    float width = getWidth();
    float height = getHeight();

    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    background.draw(batch, x, y, width, height);
    if (items.length > 0) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      int numGlyphs = font.computeVisibleGlyphs(items[selectedIndex], 0, items[selectedIndex].length(), availableWidth);
      bounds.set(font.getBounds(items[selectedIndex]));
      height -= background.getBottomHeight() + background.getTopHeight();
View Full Code Here

    float height = getHeight();

    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    float bgLeftWidth = 0;
    if (background != null) {
      background.draw(batch, x, y, width, height);
      bgLeftWidth = background.getLeftWidth();
    }

    float textY = getTextY(font, background);
    calculateOffsets();
View Full Code Here

    float y = getY();
    float width = getWidth();
    float height = getHeight();

    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    background.draw(batch, x, y, width, height);
    T selected = this.selected != null ? this.selected : selection.first();
    if (selected != null) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      String string = selected.toString();
      int numGlyphs = font.computeVisibleGlyphs(string, 0, string.length(), availableWidth);
View Full Code Here

    float y = getY();
    float width = getWidth();
    float height = getHeight();

    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    background.draw(batch, x, y, width, height);
    T selected = this.selected != null ? this.selected : selection.first();
    if (selected != null) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      String string = selected.toString();
      int numGlyphs = font.computeVisibleGlyphs(string, 0, string.length(), availableWidth);
View Full Code Here

        if (bg != null) offset = bg.getTopHeight();
        knobBefore.draw(batch, x + (int)((width - knobBefore.getMinWidth()) * 0.5f), y + offset, knobBefore.getMinWidth(),
          (int)(position + knobHeightHalf));
      }
      if (knobAfter != null) {
        knobAfter.draw(batch, x + (int)((width - knobAfter.getMinWidth()) * 0.5f), y + (int)(position + knobHeightHalf),
          knobAfter.getMinWidth(), height - (int)(position + knobHeightHalf));
      }
      if (knob != null) knob.draw(batch, x + (int)((width - knobWidth) * 0.5f), (int)(y + position), knobWidth, knobHeight);
    } else {
      bg.draw(batch, x, y + (int)((height - bg.getMinHeight()) * 0.5f), width, bg.getMinHeight());
View Full Code Here

        if (bg != null) offset = bg.getLeftWidth();
        knobBefore.draw(batch, x + offset, y + (int)((height - knobBefore.getMinHeight()) * 0.5f),
          (int)(position + knobWidthHalf), knobBefore.getMinHeight());
      }
      if (knobAfter != null) {
        knobAfter.draw(batch, x + (int)(position + knobWidthHalf), y + (int)((height - knobAfter.getMinHeight()) * 0.5f),
          width - (int)(position + knobWidthHalf), knobAfter.getMinHeight());
      }
      if (knob != null) knob.draw(batch, (int)(x + position), (int)(y + (height - knobHeight) * 0.5f), knobWidth, knobHeight);
    }
  }
View Full Code Here

    float y = getY();
    float w = getWidth();
    float h = getHeight();

    final Drawable bg = style.background;
    if (bg != null) bg.draw(batch, x, y, w, h);

    final Drawable knob = style.knob;
    if (knob != null) {
      x += knobPosition.x - knob.getMinWidth() / 2f;
      y += knobPosition.y - knob.getMinHeight() / 2f;
View Full Code Here

    final Drawable knob = style.knob;
    if (knob != null) {
      x += knobPosition.x - knob.getMinWidth() / 2f;
      y += knobPosition.y - knob.getMinHeight() / 2f;
      knob.draw(batch, x, y, knob.getMinWidth(), knob.getMinHeight());
    }
  }

  @Override
  public float getPrefWidth () {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.