本文整理汇总了Java中de.lessvoid.nifty.elements.Element.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Element.setVisible方法的具体用法?Java Element.setVisible怎么用?Java Element.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.lessvoid.nifty.elements.Element
的用法示例。
在下文中一共展示了Element.setVisible方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onStartScreen
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
@Override
public void onStartScreen() {
mission = menuState.currentMission();
mission.speedoMeterUI(screen.findElementById("speedDisplay").getRenderer(TextRenderer.class));
mission.altimeterUI(screen.findElementById("altimeter").getRenderer(TextRenderer.class));
mission.aoaUI(screen.findElementById("aoa").getRenderer(TextRenderer.class));
inputManager.setCursorVisible(false);
popupVisible = false;
Element exitMenu = screen.findElementById("exitMenuPanel");
exitMenu.setVisible(false);
}
示例2: switchIngameMenu
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
public void switchIngameMenu() {
popupVisible = !popupVisible;
inputManager.setCursorVisible(popupVisible);
cameraManager.disableCameraRotation(popupVisible);
Element exitMenu = screen.findElementById("exitMenuPanel");
exitMenu.setVisible(popupVisible);
}
示例3: onAction
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (isPressed || nifty.getCurrentScreen() != screen) {
return;
}
Element layer = screen.findElementByName("layer_settings");
layer.setVisible(!layer.isVisible());
}
示例4: showChat
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
/**Displays the chat panel
*
*/
public void showChat(){
Element chatPanel = nifty.getScreen("hud").findElementByName("chatPanel");
Element chatText = nifty.getScreen("hud").findElementByName("chatText");
if(!chatPanel.isVisible()){
chatPanel.startEffect(EffectEventId.onCustom);
chatPanel.setVisible(true);
}
chatText.setFocus();
}
示例5: actualShowWorldChest
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
/**Shows a world chest panel and suppresses internal elements
*
*/
public void actualShowWorldChest(){
Element el = nifty.getScreen("hud").findElementByName("WorldChest");
el.show();
for(Item it : screenManager.getInventoryManager().getOpenWorldChest()){
if(it.getInventoryPosition() != null){
Element toHide = nifty.getScreen("hud").findElementByName("hoverstats-"+it.getId());
if(toHide!=null){
toHide.setVisible(false);
}
}
}
}
示例6: closeContainer
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
/**Closes a container panel*/
public void closeContainer(){
Element containerPanel = nifty.getScreen("hud").findElementByName("ContainerPanel");
containerPanel.setVisible(false);
if (openContainer == null) throw new AssertionError("Trying to close a container that is not open");
screenManager.getInventoryManager().hideContainer(((AbstractContainerItem)openContainer).getContainerInventory());
openContainer = null;
}
示例7: setNextTarget
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
/**Highlights the mob given a particular target
*
* @param nextTarget - the target to highlight
*/
public void setNextTarget(Mob nextTarget){
Element mobDisplay = screenManager.getHudScreenController().getNifty().getCurrentScreen().findElementByName("MobDisplay");
mobDisplay.show();
Element mobTab = screenManager.getHudScreenController().getNifty().getCurrentScreen().findElementByName("MobTab");
if (mobSource == null){
EffectSource efSource = new EffectSource(GuiEffectType.MOBCHANGE, nifty, mobTab.getElementType(), "MobEffect", mobTab, mobTab.getFocusHandler(), false, null, null);
efSource.setActor(nextTarget);
mobTab.add(efSource);
mobSource = efSource;
}
else{
mobSource.setActor(nextTarget);
}
mobTab.startEffect(EffectEventId.onCustom);
mobTab.setVisible(true);
for(Map.Entry<Spatial, Light> e : highlightLights.entrySet()) {
e.getKey().removeLight(e.getValue());
}
AmbientLight light = new AmbientLight();
light.setColor(ColorRGBA.White.mult(3f));
nextTarget.getMesh().addLight(light);
highlightLights.put(nextTarget.getMesh(), light);
}
示例8: consumeItem
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
/**Triggered when an Item is right clicked to activate
* Processes the item according to its type, and updates
* the model accordingly
*/
@NiftyEventSubscriber(pattern="ItemVal.*")
public void consumeItem(String id, NiftyMouseSecondaryReleaseEvent event){
Item item = findItemById(id.substring(7),screenManager.getInventoryManager().getPlayer().getContainerInventory());
//container items
if (item instanceof AbstractContainerItem) {
Element containerPanel = nifty.getScreen("hud").findElementByName("ContainerPanel");
if (!containerPanel.isVisible()){
containerPanel.setVisible(true);
openContainer = item;
screenManager.getInventoryManager().loadContainer(((AbstractContainerItem)item).getContainerInventory());
}else{
closeContainer();
}
hideInnerPopups(screenManager.getInventoryManager().getPlayer().getContainerInventory());
Element containerText = nifty.getScreen("hud").findElementByName("ContainerText");
String name = null;
for (ItemDisplayTuple p : item) {
if (p.stat == Stat.NAME){
name = p.string;
}
}
if (name == null){
containerText.getRenderer(TextRenderer.class).setText("Container");
}else{
containerText.getRenderer(TextRenderer.class).setText(name);
}
return;
}
//Rightclickable items
if (item instanceof RightClickable) {
RightClickable toClick = (RightClickable) item;
toClick.rightClick();
if (!(toClick instanceof AbstractGizmo)) screenManager.getInventoryManager().removeItem(item);
for(GUIObserver g : observers){
g.onRightClicked(item);
}
return;
}
//Consumable items
if (item instanceof AbstractConsumable){
AbstractConsumable toConsume = (AbstractConsumable)item;
toConsume.rightClick();
screenManager.getInventoryManager().removeItem(item);
}
}
示例9: hideChat
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
/**Hides the chat panel
*
*/
public void hideChat(){
Element chat = nifty.getScreen("hud").findElementByName("chatPanel");
chat.setVisible(false);
}
示例10: hideShowCrossHairs
import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
public void hideShowCrossHairs(boolean show){
Element crossHairs = nifty.getScreen("hud").findElementByName("CrossHairs");
crossHairs.setVisible(show);
}