本文整理汇总了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)));
}
开发者ID:Mathgoat,项目名称:square-loot,代码行数:22,代码来源:HUD.java
示例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);
}
}
开发者ID:relu91,项目名称:niftyeditor,代码行数:14,代码来源:GElement.java
示例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);
}
}
开发者ID:Periapsis,项目名称:aphelion,代码行数:30,代码来源:ChatPlayerViewConverter.java
示例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);
}
}
开发者ID:damhonglinh,项目名称:Fruity-Bang,代码行数:11,代码来源:Game.java
示例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);
}
开发者ID:GSam,项目名称:Game-Project,代码行数:10,代码来源:OrbChanger.java
示例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);
}
开发者ID:GSam,项目名称:Game-Project,代码行数:8,代码来源:MobDisplay.java
示例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));
}
开发者ID:methusalah,项目名称:OpenRTS,代码行数:7,代码来源:GUIDrawer.java
注:本文中的de.lessvoid.nifty.elements.render.ImageRenderer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论