本文整理汇总了Java中de.lessvoid.nifty.elements.render.ImageRenderer类的典型用法代码示例。如果您正苦于以下问题:Java ImageRenderer类的具体用法?Java ImageRenderer怎么用?Java ImageRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageRenderer类属于de.lessvoid.nifty.elements.render包,在下文中一共展示了ImageRenderer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateEquipment
import de.lessvoid.nifty.elements.render.ImageRenderer; //导入依赖的package包/类
private static void updateEquipment(){
Element e = HUD.nifty.getCurrentScreen().findElementByName("equipment1");
ImageRenderer img = e.getRenderer(ImageRenderer.class);
img.setImage(itemImages.get(inventory.getInfo(InventoryItemEnum.PWEAPON)));
e = HUD.nifty.getCurrentScreen().findElementByName("equipment2");
img = e.getRenderer(ImageRenderer.class);
img.setImage(itemImages.get(inventory.getInfo(InventoryItemEnum.SWEAPON)));
e = HUD.nifty.getCurrentScreen().findElementByName("equipment3");
img = e.getRenderer(ImageRenderer.class);
img.setImage(itemImages.get(inventory.getInfo(InventoryItemEnum.SHIELD)));
e = HUD.nifty.getCurrentScreen().findElementByName("equipment4");
img = e.getRenderer(ImageRenderer.class);
img.setImage(itemImages.get(inventory.getInfo(InventoryItemEnum.ACCESSORY)));
e = HUD.nifty.getCurrentScreen().findElementByName("equipment5");
img = e.getRenderer(ImageRenderer.class);
img.setImage(itemImages.get(inventory.getInfo(InventoryItemEnum.MGEAR)));
}
示例2: removeAttribute
import de.lessvoid.nifty.elements.render.ImageRenderer; //导入依赖的package包/类
public void removeAttribute(String key) {
this.attributes.remove(key);
if (key.equals("style")) {
this.nElement.setStyle("");
this.nElement.getElementType().removeWithTag("style");
this.nElement.getRenderer(ImageRenderer.class).setImage(null);
} else {
Attributes att = this.nElement.getElementType().getAttributes();
att.set(key, "");
this.toBeRemoved.add(key);
}
}
示例3: display
import de.lessvoid.nifty.elements.render.ImageRenderer; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public final void display(final Element listBoxItem, final PlayerEntry item)
{
final Element text = listBoxItem.findElementByName(CHAT_LINE_TEXT);
final TextRenderer textRenderer = text.getRenderer(TextRenderer.class);
final Element icon = listBoxItem.findElementByName(CHAT_LINE_ICON);
final ImageRenderer iconRenderer = icon.getRenderer(ImageRenderer.class);
if (item != null)
{
textRenderer.setText(item.toString());
iconRenderer.setImage(item.getIcon());
if (item.getStyle() != null && !item.getStyle().equals(""))
{
text.setStyle(item.getStyle());
}
else
{
text.setStyle("default");
}
}
else
{
textRenderer.setText("");
iconRenderer.setImage(null);
}
}
示例4: setMute
import de.lessvoid.nifty.elements.render.ImageRenderer; //导入依赖的package包/类
public void setMute() {
Screen screen = nifty.getCurrentScreen();
Element element = screen.findElementByName("mute");
if (!isMute[0]) {
element.getRenderer(ImageRenderer.class).setImage(on);
} else {
element.getRenderer(ImageRenderer.class).setImage(mute);
}
}
示例5: changeElementImage
import de.lessvoid.nifty.elements.render.ImageRenderer; //导入依赖的package包/类
/**Helper method for changing the image of an orb
*/
protected void changeElementImage(final NiftyImage image) {
ImageRenderer imageRenderer = element.getRenderer(ImageRenderer.class);
if (imageRenderer == null) {
return;
}
imageRenderer.setImage(image);
}
示例6: changeElementImage
import de.lessvoid.nifty.elements.render.ImageRenderer; //导入依赖的package包/类
private void changeElementImage(final NiftyImage image) {
ImageRenderer imageRenderer = element.getRenderer(ImageRenderer.class);
if (imageRenderer == null) {
return;
}
imageRenderer.setImage(image);
}
示例7: setBackground
import de.lessvoid.nifty.elements.render.ImageRenderer; //导入依赖的package包/类
protected void setBackground(String id, String backgroundPath){
Element e = guiCtrl.getElement(id);
if(e == null || e.getRenderer(ImageRenderer.class) == null)
throw new IllegalArgumentException("can't find element with background '"+id+"'.");
e.getRenderer(ImageRenderer.class).setImage(guiCtrl.nifty.createImage(backgroundPath, false));
}