Window Title not showing up, as the dragbar

Hello,

Today i got a weird issue with all window on my current project not showing up the dragbar, so the win title did not show up, did i mised something with last update ? On my project nothing has changed, and everything was “ok”, i’ve only did some update (reinstallation mainly of my computer so jme and all pugin as well).

Ps : not related to this issue(or maybe it is) but i got another stange behaviour as when i add a new screen and attach it to the guiNode, it add me a grey box on the top left corner of the screen, to remove it i’ve did some strange stuff(not so stange but it’s weird to have to do that when before i havn’t)… here is the code :
[java]screen = new Screen(this);
this.guiNode.addControl(screen); //the grey box is added when doing this.
for(Element e : screen.getElementsAsMap().values()){
screen.removeElement(e);
}
screen.getElementsAsMap().clear();[/java]

Ps 2 : i’m using the 0.4.6.1422 version as said in the plugins manager.

@kobRoah said: Hello,

Today i got a weird issue with all window on my current project not showing up the dragbar, so the win title did not show up, did i mised something with last update ? On my project nothing has changed, and everything was “ok”, i’ve only did some update (reinstallation mainly of my computer so jme and all pugin as well).

Ps : not related to this issue(or maybe it is) but i got another stange behaviour as when i add a new screen and attach it to the guiNode, it add me a grey box on the top left corner of the screen, to remove it i’ve did some strange stuff(not so stange but it’s weird to have to do that when before i havn’t)… here is the code :
[java]screen = new Screen(this);
this.guiNode.addControl(screen); //the grey box is added when doing this.
for(Element e : screen.getElementsAsMap().values()){
screen.removeElement(e);
}
screen.getElementsAsMap().clear();[/java]

Ps 2 : i’m using the 0.4.6.1422 version as said in the plugins manager.

Couple questions so I can determine what happened.

  1. Are you using JME’s nightly build?
  2. Are you using custom style .gui.xml files?
  3. Have you run clean & build on your project to ensure it isn’t some caching issue?

I noticed that calling showWithEffect on window with no effect added doesn’t show the BitmapTextFonts, they appear on hover for buttons.
Maybe it is related.

@jonesadev said: I noticed that calling showWithEffect on window with no effect added doesn't show the BitmapTextFonts, they appear on hover for buttons. Maybe it is related.

Ah! Thanks for this! This answers the question above and lets me know how to fix it. Sorry about this. It is the fix I added for text alpha fades… it apparently broke things when not using FadeIn or FadeOut. I’ll try and get this fixed up to work in both cases. Sorry for the inconvenience!

Just one last note to let you know I confirmed this is the problem. I should have it fixed in an hour or so. Have to feed kids (to the snakes … muhahahaha… I mean feed them dinner)

This is now fixed.

You can either update from the repo or wait for tonight’s patch!

Thanks a lot :D.

To answer btw,

  1. I’m not using the nighty build… i guess since i use the one provided on the download section.
  2. No, i’m sure about that ^^
  3. i have no idea on what talking about XD
@kobRoah said: Thanks a lot :D.

To answer btw,

  1. I’m not using the nighty build… i guess since i use the one provided on the download section.

  2. No, i’m sure about that ^^

  3. i have no idea on what talking about XD

  • Awesome… this causes problems atm (will fix for updates when a new version is released that contains the updates in nightly)

  • Ok, It’s fine to do, I just had a thought that perhaps some update had gone through with a change to styles in some way that might effect your custom styles.

  • This one is important for Android dev as you have to disable Compile On Save and sometimes problems show up that aren’t really there. If you right-click over the project name, you’ll see ‘Clean & Build’ as an option… it removes all files from the build directory and re-compiles the project.

  • No i’m not develloping for android, so as i’ve understand i’m not concerned by this one, i’ll wait for the update of jme so. For time being i can deal with it ^^

    The contributions always get updated directly, you don’t need nightly for that.

    @normen thanks to say.
    After a check i got an update, i didn’t noticed the fact it updated from 0.4.6.1422 to 0.4.6.1436 version. But i still got the same issue… no header and no title :confused:

    Ps: I still got the issue with a grey box been added when doing [java]app.getGuiNode().addControl(screen); [/java]

    @kobRoah said: @normen thanks to say. After a check i got an update, i didn't noticed the fact it updated from 0.4.6.1422 to 0.4.6.1436 version. But i still got the same issue... no header and no title :/

    Ps: I still got the issue with a grey box been added when doing [java]app.getGuiNode().addControl(screen); [/java]

    Having trouble repro’ing this issue, but I’ll see what I can do to fix it.

    Did the text issue get resolved? Erm… nm… just saw the answer.

    Odd… you did download the update, correct? Tools > Plugins then clicked Check for Updates… then clicked Update?

    Also, did you run ‘Clean & Build’ on your project?

    EDIT: I take it you are creating the screen and adding it as a control from a class other than your main class? Not that this should matter, just curious from the app.getGuiNode() call

    I got the latest version who i can have from doing Tools > Plugins, as say i got the “tonegodGUI - Version: 0.4.6.1436”, yes i’ve clicked on the update button. :lol:
    I’ve did the ‘Clean & Build’ on my project, no change at all.

    On my main class during the init i call this method as :
    [java]
    private void initScreen() {
    screen = new Screen(this);
    this.guiNode.addControl(screen); //Here i got the grey box issue
    /** everything from there is for deleting that box */
    for(Element e : screen.getElementsAsMap().values()){
    screen.removeElement(e);
    }
    screen.getElementsAsMap().clear();
    }
    [/java]

    Btw, i’ve created a new empty jme prject to try out if it’s not comming from my current project, and, i got the same issue, i got a grey box and the title + dragbar not appearing… test case :
    [java]
    Screen screen = new Screen(this);
    this.guiNode.addControl(screen);
    // for(Element e : screen.getElementsAsMap().values()){
    // screen.removeElement(e);
    // }
    // screen.getElementsAsMap().clear();

        Window win = new Window(screen, new Vector2f(150,150));
        win.setWindowTitle("hello world !");
    

    // win.getDragBar().setHeight(30f);
    // win.getDragBar().centerToParent();
    // win.getDragBar().show();
    // win.getDragBar().childShow();

        screen.addElement(win);
    

    [/java]
    As you can see i’ve tryed a lot of weird stuff, i don’t even know if they matter but no change at all XD.

    Since i got this issue after i’ve reinstalled all my system and since i don’t use the same graphics card drivers than before could it come from that ? (weird but…)

    I ran the test case:

    Can you copy and paste the actual file you are seeing this with, as I can’t repro this when running your test case. And post a screen shot so I can see the issue as well.

    EDIT: Also, can you give me some info about the computer you are running this on?

    OS
    Graphics card
    JME version
    etc

    TestCase file :
    [java]
    package mygame;

    import com.jme3.app.SimpleApplication;
    import com.jme3.math.Vector2f;
    import tonegod.gui.core.Screen;
    import com.jme3.renderer.RenderManager;
    import tonegod.gui.controls.windows.Window;

    /**

    • test

    • @author normenhansen
      */
      public class Main extends SimpleApplication {

      public static void main(String[] args) {
      Main app = new Main();
      app.start();
      }

      @Override
      public void simpleInitApp() {
      Screen screen = new Screen(this);
      this.guiNode.addControl(screen);
      // for(Element e : screen.getElementsAsMap().values()){
      // screen.removeElement(e);
      // }
      // screen.getElementsAsMap().clear();

       Window win = new Window(screen, new Vector2f(150,150));
       win.setWindowTitle("hello world !");
       win.getDragBar().setHeight(30f);
       win.getDragBar().centerToParent();
       win.getDragBar().show();
       win.getDragBar().childShow();
       win.getDragBar().validateLayout();
      

    // win.getDragBar().show();
    // win.setText(“hello world !”);
    screen.addElement(win);
    }

    @Override
    public void simpleUpdate(float tpf) {
        //TODO: add update code
    }
    
    @Override
    public void simpleRender(RenderManager rm) {
        //TODO: add render code
    }
    

    }
    [/java]

    Output :

    I run with :
    Kubuntu 14.04 (64bit) up to date,
    Gtx 650 (using server X X.org as drivers(other drivers give me a lwjgl error when running a project))
    Version: 3.0.9 Source: jMonkeyEngine SDK Stable
    OpenGL 3.0 Mesa 10.1.0

    other stuff found on jme -> help -> about :
    Product Version: jMonkeyEngine SDK 3.0
    Java: 1.7.0_51; Java HotSpot™ 64-Bit Server VM 24.51-b03
    Runtime: Java™ SE Runtime Environment 1.7.0_51-b13
    System: Linux version 3.13.0-24-generic running on amd64; UTF-8; fr_FR (jmonkeyplatform)

    If i missed something feel free to ask, thanks for helping me :slight_smile:

    1 Like

    Using your test class, I get the same as tonegod, apart from the title bar being in the middle (due to win.getDragBar().centerToParent();).

    Win 7 64
    Monkey: 3.09 - same version of tonegodGUI as you.
    Also worked on Monkey: 3.05 - tonegodGUI 1.422.

    1 Like
    @kobRoah said: TestCase file : [java] package mygame;

    import com.jme3.app.SimpleApplication;
    import com.jme3.math.Vector2f;
    import tonegod.gui.core.Screen;
    import com.jme3.renderer.RenderManager;
    import tonegod.gui.controls.windows.Window;

    /**

    • test

    • @author normenhansen
      */
      public class Main extends SimpleApplication {

      public static void main(String args) {
      Main app = new Main();
      app.start();
      }

      @Override
      public void simpleInitApp() {
      Screen screen = new Screen(this);
      this.guiNode.addControl(screen);
      // for(Element e : screen.getElementsAsMap().values()){
      // screen.removeElement(e);
      // }
      // screen.getElementsAsMap().clear();

       Window win = new Window(screen, new Vector2f(150,150));
       win.setWindowTitle("hello world !");
       win.getDragBar().setHeight(30f);
       win.getDragBar().centerToParent();
       win.getDragBar().show();
       win.getDragBar().childShow();
       win.getDragBar().validateLayout();
      

    // win.getDragBar().show();
    // win.setText(“hello world !”);
    screen.addElement(win);
    }

    @Override
    public void simpleUpdate(float tpf) {
        //TODO: add update code
    }
    
    @Override
    public void simpleRender(RenderManager rm) {
        //TODO: add render code
    }
    

    }
    [/java]

    Output :

    I run with :
    Kubuntu 14.04 (64bit) up to date,
    Gtx 650 (using server X X.org as drivers(other drivers give me a lwjgl error when running a project))
    Version: 3.0.9 Source: jMonkeyEngine SDK Stable
    OpenGL 3.0 Mesa 10.1.0

    other stuff found on jme -> help -> about :
    Product Version: jMonkeyEngine SDK 3.0
    Java: 1.7.0_51; Java HotSpot™ 64-Bit Server VM 24.51-b03
    Runtime: Java™ SE Runtime Environment 1.7.0_51-b13
    System: Linux version 3.13.0-24-generic running on amd64; UTF-8; fr_FR (jmonkeyplatform)

    If i missed something feel free to ask, thanks for helping me :slight_smile:

    Ok, this gives me a bit to go on, I thought I had a few other Linux users that weren’t having issues (maybe I was wrong).

    Do me a favor and add this code after adding the screen as a control and let me know what the output is:

    [java]
    System.out.println(screen.getWidth() + " : " + screen.getHeight());
    System.out.println(getViewPort().getCamera().getWidth() + " : " + getViewPort().getCamera().getHeight());
    [/java]

    Make sure it is reporting the resolution you selected. Right now, it looks to me as if it is not…

    @loopies said: Using your test class, I get the same as tonegod, apart from the title bar being in the middle (due to win.getDragBar().centerToParent();).

    Win 7 64
    Monkey: 3.09 - same version of tonegodGUI as you.
    Also worked on Monkey: 3.05 - tonegodGUI 1.422.

    Thanks for running this! Most appreciated!

    Also, comment out these lines and let me know what happens:

    [java]
    win.getDragBar().setHeight(30f);
    win.getDragBar().centerToParent();
    win.getDragBar().show();
    win.getDragBar().childShow();
    win.getDragBar().validateLayout();
    [/java]

    I know that validateLayout was experimental for flipping the Y axis (I think… I probably should remove this).

    I’ve added the line :
    [java]
    System.out.println(screen.getWidth() + " : " + screen.getHeight());
    System.out.println(getViewPort().getCamera().getWidth() + " : " + getViewPort().getCamera().getHeight());

    //output :
    //1280.0 : 720.0
    //1280 : 720
    [/java]

    Seem to be ok since that’s the selected resolution.

    I’ve runned other test and now i can see a part of the dragbar… :

    Used code :
    [java]
    @Override
    public void simpleInitApp() {
    // Disable the default flyby cam
    flyCam.setEnabled(false);

        Screen screen = new Screen(this);
        System.out.println(screen.getWidth() + " : " + screen.getHeight());
        System.out.println(getViewPort().getCamera().getWidth() + " : " + getViewPort().getCamera().getHeight());
        this.guiNode.addControl(screen);
        for(Element e : screen.getElementsAsMap().values()){
            screen.removeElement(e);
        }
        screen.getElementsAsMap().clear();
        
        Window win = new Window(screen, new Vector2f(150,150));
        win.setWindowTitle("hello world as title !");
        win.setIsResizable(false);
        
        win.getDragBar().setDimensions(500f, 200f); //This make the output show on the screenshoot
        
        /** Method bellow didn't change the issue
        win.getDragBar().centerToParent();
        win.getDragBar().show();
        win.getDragBar().childShow();
        win.getDragBar().setZOrder(-1f); //still not showing when using (+1f)
        win.getDragBar().setCullHint(Spatial.CullHint.Never);
        win.getDragBar().setText("hello DraBar !");
        win.getDragBar().validateLayout();
        */
        
        win.setText("hello world on the window as text !");
        screen.addElement(win);
        
        System.out.println(screen.getElementById(win.getDragBar().getUID()).getName());// <- confirm the fact the drag bar is there
        System.out.println(win.getDragBar().getZOrder() + " + " + win.getZOrder()); 
    

    /** Output :
    *1280.0 : 720.0
    *1280 : 720
    *35f2e42c-be3f-4e6a-ba50-154b56e6fa6f:DragBar:Node
    *0.0 + 0.0
    */
    }
    [/java]