jme3tests: Updated HUD code to use setDisplayStatView(false) instead of guideNode.detachAll(). Recentered crosshairs.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9399 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
9264e0ea32
commit
4dd46f4c5b
engine/src/test/jme3test
@ -66,7 +66,7 @@ public class TestChangeAppIcon extends SimpleApplication {
|
||||
@Override
|
||||
public void simpleInitApp() {
|
||||
// Write text on the screen (HUD)
|
||||
guiNode.detachAllChildren();
|
||||
setDisplayStatView(false);
|
||||
BitmapText helloText = new BitmapText(guiFont);
|
||||
helloText.setText("The icon of the app should be a smart monkey!");
|
||||
helloText.setLocalTranslation(300, helloText.getLineHeight(), 0);
|
||||
|
@ -69,7 +69,7 @@ public class HelloAssets extends SimpleApplication {
|
||||
rootNode.attachChild(wall);
|
||||
|
||||
/** Display a line of text (default font from test-data) */
|
||||
guiNode.detachAllChildren();
|
||||
setDisplayStatView(false);
|
||||
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
|
||||
BitmapText helloText = new BitmapText(guiFont, false);
|
||||
helloText.setSize(guiFont.getCharSet().getRenderedSize());
|
||||
|
@ -215,14 +215,14 @@ public class HelloPhysics extends SimpleApplication {
|
||||
|
||||
/** A plus sign used as crosshairs to help the player with aiming.*/
|
||||
protected void initCrossHairs() {
|
||||
guiNode.detachAllChildren();
|
||||
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
|
||||
setDisplayStatView(false);
|
||||
//guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
|
||||
BitmapText ch = new BitmapText(guiFont, false);
|
||||
ch.setSize(guiFont.getCharSet().getRenderedSize() * 2);
|
||||
ch.setText("+"); // fake crosshairs :)
|
||||
ch.setLocalTranslation( // center
|
||||
settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 2,
|
||||
settings.getHeight() / 2 + ch.getLineHeight() / 2, 0);
|
||||
settings.getWidth() / 2,
|
||||
settings.getHeight() / 2, 0);
|
||||
guiNode.attachChild(ch);
|
||||
}
|
||||
}
|
||||
|
@ -154,14 +154,13 @@ public class HelloPicking extends SimpleApplication {
|
||||
|
||||
/** A centred plus sign to help the player aim. */
|
||||
protected void initCrossHairs() {
|
||||
guiNode.detachAllChildren();
|
||||
setDisplayStatView(false);
|
||||
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
|
||||
BitmapText ch = new BitmapText(guiFont, false);
|
||||
ch.setSize(guiFont.getCharSet().getRenderedSize() * 2);
|
||||
ch.setText("+"); // crosshairs
|
||||
ch.setLocalTranslation( // center
|
||||
settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 2,
|
||||
settings.getHeight() / 2 + ch.getLineHeight() / 2, 0);
|
||||
settings.getWidth() / 2, settings.getHeight() / 2, 0);
|
||||
guiNode.attachChild(ch);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user