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

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


        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 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 (background != null) {
      Color color = getColor();
      batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
      background.draw(batch, getX(), getY(), getWidth(), getHeight());
    }

    Array<Actor> children = getChildren();
    for (int i = 0; i < children.size; i++)
      children.get(i).translate(offsetX, offsetY);
View Full Code Here

    font.setColor(fontColorUnselected.r, fontColorUnselected.g, fontColorUnselected.b, fontColorUnselected.a * parentAlpha);
    float itemY = getHeight();
    for (int i = 0; i < items.length; i++) {
      if (cullingArea == null || (itemY - itemHeight <= cullingArea.y + cullingArea.height && itemY >= cullingArea.y)) {
        if (selectedIndex == i) {
          selectedDrawable.draw(batch, x, y + itemY - itemHeight, getWidth(), itemHeight);
          font.setColor(fontColorSelected.r, fontColorSelected.g, fontColorSelected.b, fontColorSelected.a * parentAlpha);
        }
        font.draw(batch, items[i], x + textOffsetX, y + itemY - textOffsetY);
        if (selectedIndex == i) {
          font.setColor(fontColorUnselected.r, fontColorUnselected.g, fontColorUnselected.b, fontColorUnselected.a
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

        batch.flush();
        ScissorStack.popScissors();
      }
    }
    batch.setColor(color.r, color.g, color.b, color.a);
    handle.draw(batch, handleBounds.x, handleBounds.y, handleBounds.width, handleBounds.height);
    resetTransform(batch);
  }

  /** @param split The split amount between the min and max amount. */
  public void setSplitAmount (float split) {
View Full Code Here

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

      if (knobBefore != null) {
        knobBefore.draw(batch, x, y + (int)((height - knobBefore.getMinHeight()) * 0.5f), (int)(sliderPos + knobHeightHalf),
          knobBefore.getMinHeight());
      }
      if (knobAfter != null) {
        knobAfter.draw(batch, x + (int)(sliderPos + knobHeightHalf), y + (int)((height - knobAfter.getMinHeight()) * 0.5f),
          width - (int)(sliderPos + knobHeightHalf), knobAfter.getMinHeight());
      }
      if (knob != null)
        knob.draw(batch, (int)(x + sliderPos), (int)(y + (height - knobHeight) * 0.5f), knobWidth, knobHeight);
    }
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.