当前位置: 首页>>代码示例>>Java>>正文


Java Element.setVisible方法代码示例

本文整理汇总了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);
}
 
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:12,代码来源:MissionMenu.java

示例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);
}
 
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:8,代码来源:MissionMenu.java

示例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());
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:10,代码来源:HudMenu.java

示例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();
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:13,代码来源:HudScreenController.java

示例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);
			}
		}
	}
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:16,代码来源:HudScreenController.java

示例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;
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:9,代码来源:HudScreenController.java

示例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);
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:34,代码来源:PlayerStatManager.java

示例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);
	}
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:55,代码来源:HudScreenController.java

示例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);
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:8,代码来源:HudScreenController.java

示例10: hideShowCrossHairs

import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
public void hideShowCrossHairs(boolean show){
	Element crossHairs = nifty.getScreen("hud").findElementByName("CrossHairs");
	crossHairs.setVisible(show);
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:5,代码来源:HudScreenController.java


注:本文中的de.lessvoid.nifty.elements.Element.setVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。