本文整理汇总了Java中com.jme3.niftygui.NiftyJmeDisplay.getNifty方法的典型用法代码示例。如果您正苦于以下问题:Java NiftyJmeDisplay.getNifty方法的具体用法?Java NiftyJmeDisplay.getNifty怎么用?Java NiftyJmeDisplay.getNifty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.niftygui.NiftyJmeDisplay
的用法示例。
在下文中一共展示了NiftyJmeDisplay.getNifty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simpleInitApp
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
public void simpleInitApp() {
Box b = new Box(Vector3f.ZERO, 1, 1, 1);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
geom.setMaterial(mat);
rootNode.attachChild(geom);
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
inputManager,
audioRenderer,
guiViewPort);
nifty = niftyDisplay.getNifty();
URL url = Thread.currentThread().getContextClassLoader().getResource("jme3test/niftygui/hellojme.xml");
nifty.fromXml("Interface/Nifty/HelloJme.xml", "start", this);
// attach the nifty display to the gui view port as a processor
guiViewPort.addProcessor(niftyDisplay);
// disable the fly cam
// flyCam.setEnabled(false);
flyCam.setDragToRotate(true);
}
示例2: initialize
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
public void initialize(AppStateManager stateManager, Application app) {
if (niftyXmlPath != null) {
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(app.getAssetManager(),
app.getInputManager(),
app.getAudioRenderer(),
app.getGuiViewPort());
nifty = niftyDisplay.getNifty();
nifty.fromXmlWithoutStartScreen(niftyXmlPath);
app.getGuiViewPort().addProcessor(niftyDisplay);
}
for (CinematicEvent cinematicEvent : cinematicEvents) {
cinematicEvent.initEvent(app, this);
}
initialized = true;
}
示例3: initialize
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
this.app = (Main) app;
this.app.getFlyByCamera().setEnabled(false);
this.app.getInputManager().deleteMapping(SimpleApplication.INPUT_MAPPING_EXIT);
this.app.getInputManager().addMapping(TOGGLE_OPTIONS, new KeyTrigger(KeyInput.KEY_ESCAPE));
this.app.getInputManager().addListener(this, TOGGLE_OPTIONS);
this.app.getInputManager().setCursorVisible(true);
niftyJmeDisplay =
new NiftyJmeDisplay(
this.app.getAssetManager(),
this.app.getInputManager(),
this.app.getAudioRenderer(),
this.app.getRenderManager().getPostView(GUIDEFAULT)
);
nifty = niftyJmeDisplay.getNifty();
this.app.getRenderManager().getPostView(GUIDEFAULT).addProcessor(niftyJmeDisplay);
nifty.fromXml("Interface/nifty/MagicallyousGUI.xml", "start");
NiftyController.registerApp(this.app);
//nifty.setDebugOptionPanelColors(true);
this.app.getInputManager().setCursorVisible(true);
}
示例4: initialize
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
app.getViewPort().attachScene(rootNode);
niftyDisplay = new NiftyJmeDisplay(app.getAssetManager(), app.getInputManager(), app.getAudioRenderer(), app.getGuiViewPort());
Nifty nifty = niftyDisplay.getNifty();
stateManager.attach(LoginScreen.getSingleton());
nifty.fromXml("Interface/Nifty/Main.xml", "screenLogin", LoginScreen.getSingleton(), CharsScreen.getSingleton(), WorldScreen.getSingleton());
Logger.getLogger("de.lessvoid.nifty").setLevel(Level.SEVERE);
Logger.getLogger("NiftyInputEventHandlingLog").setLevel(Level.SEVERE);
app.getGuiViewPort().addProcessor(niftyDisplay);
this.app = app;
rootNode.setCullHint(CullHint.Dynamic);
}
示例5: initialize
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
this.app = (SimpleApplication) app; // can cast Application to something more specific
this.rootNode = this.app.getRootNode();
this.assetManager = this.app.getAssetManager();
this.stateManager = this.app.getStateManager();
this.inputManager = this.app.getInputManager();
this.guiViewPort = this.app.getGuiViewPort();
this.flyCam = this.app.getFlyByCamera();
this.timer = this.app.getTimer();
// Create and show the beginning gui display
disp = new NiftyJmeDisplay(
assetManager, inputManager, audioRenderer, guiViewPort);
nifty = disp.getNifty();
nifty.fromXml("Interface/start.xml", "start", this);
// Initialize the drop down elements that is persistent
initDropDown();
}
示例6: checkCompletion
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
public void checkCompletion() {
if (isCompleted()) {
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(
assetManager, inputManager, Main.getApp().getAudioRenderer(), Main.getApp().getGuiViewPort());
/**
* Create a new NiftyGUI object
*/
Nifty nifty = niftyDisplay.getNifty();
/**
* Read your XML and initialize your custom ScreenController
*/
nifty.fromXml("Interface/gameWon.xml", "start");
// nifty.fromXml("Interface/helloworld.xml", "start", new MySettingsScreen(data));
// attach the Nifty display to the gui view port as a processor
Main.getApp().getGuiViewPort().addProcessor(niftyDisplay);
// disable the fly cam
Main.getApp().getFlyByCamera().setDragToRotate(true);
}
}
示例7: startNifty
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
private void startNifty() {
guiNode.detachAllChildren();
niftyDisplay = new NiftyJmeDisplay(assetManager,
inputManager, audioRenderer, guiViewPort);
nifty = niftyDisplay.getNifty();
nifty.fromXml("Interface/ClientUI.xml", "main_menu",
new MainMenu(),
new ConnectionMenu(),
new ReplayMenu(),
new KeySetter(this, inputManager, inputSettings),
hud,
ClientSettings.getClientSettings());
guiViewPort.addProcessor(niftyDisplay);
hud.setNifty(nifty);
}
示例8: simpleInitApp
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
public void simpleInitApp() {
Box b = new Box(Vector3f.ZERO, 1, 1, 1);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
geom.setMaterial(mat);
rootNode.attachChild(geom);
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
inputManager,
audioRenderer,
guiViewPort);
nifty = niftyDisplay.getNifty();
nifty.fromXml("Interface/Nifty/HelloJme.xml", "start", this);
// attach the nifty display to the gui view port as a processor
guiViewPort.addProcessor(niftyDisplay);
// disable the fly cam
// flyCam.setEnabled(false);
// flyCam.setDragToRotate(true);
inputManager.setCursorVisible(true);
}
示例9: initialize
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
public void initialize(AppStateManager stateManager, Application app) {
if (niftyXmlPath != null) {
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(app.getAssetManager(),
app.getInputManager(),
app.getAudioRenderer(),
app.getGuiViewPort());
nifty = niftyDisplay.getNifty();
nifty.fromXmlWithoutStartScreen(niftyXmlPath);
app.getGuiViewPort().addProcessor(niftyDisplay);
}
initEvent(app, this);
for (CinematicEvent cinematicEvent : cinematicEvents) {
cinematicEvent.initEvent(app, this);
}
initialized = true;
}
示例10: simpleInitApp
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
client.addClientStateListener(this);
client.addErrorListener(this);
assetManager.registerLocator("assets", FileLocator.class);
// Set up GUI Heads up display
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
/** Create a new NiftyGUI object */
nifty = niftyDisplay.getNifty();
nifty.loadStyleFile("nifty-default-styles.xml");
nifty.loadControlFile("nifty-default-controls.xml");
guiViewPort.addProcessor(niftyDisplay); // add to gui port
sm = new ScreenManager(nifty, inputManager,this);
sm.getHudScreenController().addObserver(this);
world = new World();
world.attachScreenManager(sm);
flyCam.setEnabled(false);
setPauseOnLostFocus(false);
}
示例11: simpleInitApp
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
//Set up GUI Heads up display
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, viewPort);
nifty = niftyDisplay.getNifty();
nifty.loadStyleFile("nifty-default-styles.xml");
nifty.loadControlFile("nifty-default-controls.xml");
screenManager = new ScreenManager(nifty, inputManager,this);
guiViewPort.addProcessor(niftyDisplay); //add to gui port
InputListener.addMappings(inputManager);
//Set up world
assets = assetManager;
viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f)); //just for testing purposes
setWorld2(new World());
fpsText.setText("");
rootNode.setShadowMode(ShadowMode.CastAndReceive);
setDisplayFps(false);
setDisplayStatView(false);
flyCam.setEnabled(false);
}
示例12: simpleInitApp
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
public void simpleInitApp() {
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
inputManager,
audioRenderer,
guiViewPort);
nifty = niftyDisplay.getNifty();
nifty.fromXml("all/intro.xml", "start");
// attach the nifty display to the gui view port as a processor
guiViewPort.addProcessor(niftyDisplay);
// disable the fly cam
flyCam.setEnabled(false);
}
示例13: simpleInitApp
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
public void simpleInitApp() {
ViewPort niftyView = renderManager.createPreView("NiftyView", new Camera(1024, 768));
niftyView.setClearFlags(true, true, true);
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
inputManager,
audioRenderer,
niftyView);
nifty = niftyDisplay.getNifty();
nifty.fromXml("all/intro.xml", "start");
niftyView.addProcessor(niftyDisplay);
Texture2D depthTex = new Texture2D(1024, 768, Format.Depth);
FrameBuffer fb = new FrameBuffer(1024, 768, 1);
fb.setDepthTexture(depthTex);
Texture2D tex = new Texture2D(1024, 768, Format.RGBA8);
tex.setMinFilter(MinFilter.Trilinear);
tex.setMagFilter(MagFilter.Bilinear);
fb.setColorTexture(tex);
niftyView.setClearFlags(true, true, true);
niftyView.setOutputFrameBuffer(fb);
Box b = new Box(Vector3f.ZERO, 1, 1, 1);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", tex);
geom.setMaterial(mat);
rootNode.attachChild(geom);
}
示例14: initGui
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
private void initGui() {
guiController = new GuiController();
NiftyJmeDisplay niftyDisplay= new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
Nifty nifty = niftyDisplay.getNifty();
String viewFname = "Interface/guiview.xml";
try {
nifty.validateXml(viewFname);
} catch (Exception ex) {
logger.log(Level.SEVERE, viewFname + " not valid", ex);
}
nifty.fromXml(viewFname, "guiView", guiController);
stateManager.attach(guiController);
// nifty.setDebugOptionPanelColors(true);
guiViewPort.addProcessor(niftyDisplay);
}
示例15: initialize
import com.jme3.niftygui.NiftyJmeDisplay; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
this.app = (MVApplication) app;
assetManager = app.getAssetManager();
guiNode = this.app.getRootNode();
java.util.logging.Logger.getLogger("de.lessvoid.nifty")
.setLevel(java.util.logging.Level.OFF);
display = new NiftyJmeDisplay(
app.getAssetManager(), app.getInputManager(),
app.getAudioRenderer(), ((SimpleApplication) app).getGuiViewPort());
nifty = display.getNifty();
nifty.fromXml(Constants.android ? "Interface/nifty-android.xml"
: "Interface/nifty-desktop.xml", "start", this);
((SimpleApplication) app).getGuiViewPort().addProcessor(display);
background = new Picture("Background Image!");
background.setImage(assetManager,
Constants.android ? "Textures/nifty-background-lq.jpg"
: "Textures/nifty-background-hq.jpg", false);
guiNode.attachChild(background);
}