com.badlogic.gdx.scenes.scene2d.ui.Image.getDrawable()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Image.getDrawable()方法的一些代码示例,展示了Image.getDrawable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.getDrawable()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Image
类名称:Image
方法名:getDrawable

Image.getDrawable介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

public String toString () {
  String name = getName();
  if (name != null) return name;
  String className = getClass().getName();
  int dotIndex = className.lastIndexOf('.');
  if (dotIndex != -1) className = className.substring(dotIndex + 1);
  return (className.indexOf('$') != -1 ? "ImageButton " : "") + className + ": " + image.getDrawable();
}

代码示例来源:origin: libgdx/libgdx

public String toString () {
  String name = getName();
  if (name != null) return name;
  String className = getClass().getName();
  int dotIndex = className.lastIndexOf('.');
  if (dotIndex != -1) className = className.substring(dotIndex + 1);
  return (className.indexOf('$') != -1 ? "ImageButton " : "") + className + ": " + image.getDrawable();
}

代码示例来源:origin: libgdx/libgdx

public String toString () {
  String name = getName();
  if (name != null) return name;
  String className = getClass().getName();
  int dotIndex = className.lastIndexOf('.');
  if (dotIndex != -1) className = className.substring(dotIndex + 1);
  return (className.indexOf('$') != -1 ? "ImageTextButton " : "") + className + ": " + image.getDrawable() + " "
    + label.getText();
}

代码示例来源:origin: libgdx/libgdx

public String toString () {
  String name = getName();
  if (name != null) return name;
  String className = getClass().getName();
  int dotIndex = className.lastIndexOf('.');
  if (dotIndex != -1) className = className.substring(dotIndex + 1);
  return (className.indexOf('$') != -1 ? "ImageTextButton " : "") + className + ": " + image.getDrawable() + " "
    + label.getText();
}

代码示例来源:origin: dingjibang/GDX-RPG

public Texture texture(){
  Actor actor=t;
  if(actor instanceof Image)
    return $.getTexture(((Image)actor).getDrawable());
  return null;
}

代码示例来源:origin: dingjibang/GDX-RPG

public Texture texture(){
  Actor actor=get();
  if(actor instanceof Image)
    return $.getTexture(((Image)actor).getDrawable());
  return null;
}

代码示例来源:origin: dingjibang/GDX-RPG

public TypedGdxQuery<T> filter(TextureFilter filter) {
  if(t instanceof Image)
    ((TextureRegionDrawable)((Image) t).getDrawable()).getRegion().getTexture().setFilter(filter, filter);
  return this;
}

代码示例来源:origin: dingjibang/GDX-RPG

public GdxQuery filter(TextureFilter filter) {
  for(Actor actor : list())
    if(actor instanceof Image)
      ((TextureRegionDrawable)((Image) actor).getDrawable()).getRegion().getTexture().setFilter(filter, filter);
  return this;
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

@Override
public Actor build(BaseModel model, Group parent) {
  ImageModel imageModel = (ImageModel) model;
  Image image;
  if (imageModel.getTextureSrc() != null) {
    image = createFromTexture(imageModel);
  } else {
    image = createFromTextureAtlas(imageModel);
  }
  normalizeModelSize(imageModel, parent,
      image.getDrawable().getMinWidth(),
      image.getDrawable().getMinHeight());
  setBasicProperties(model, image);
  if (ImageModel.TYPE_BACKGROUND.equals(imageModel.getType())) {
    updateBackgroundImagePosition(image);
  }
  return image;
}

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

@Override
public void sizeChanged() {
  super.sizeChanged();
  for(Actor a:arrowPanel.getChildren()) {
    ImageButton b = (ImageButton)a;
    float h = (getHeight() / 2)  - style.infoLineLabelStyle.font.getLineHeight() / 2 - DPIUtils.getSpacing();
    float ih = b.getImage().getDrawable().getMinHeight();
    float iw = b.getImage().getDrawable().getMinWidth() *  h / ih;
    b.getImageCell().maxSize(iw, h);
  }
  arrowPanel.invalidateHierarchy();
}

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

@Override
public void act(float delta) {
  super.act(delta);
  Inventory inv = sceneScreen.getUI().getWorld().getInventory();
  // fill inventory
  for (int i = 0; i < inventorySlots.size(); i++) {
    RendererDrawable r = (RendererDrawable) inventorySlots.get(i).getImage().getDrawable();
    
    int pos = scroll * INVENTORY_COLS + i;
    if (pos < inv.getNumItems()) {
      r.setRenderer(inv.get(pos).getRenderer());                
    } else {
      r.setRenderer(null);
    }
    
    inventorySlots.get(i).getImage().invalidate();
  }
}

相关文章