Hello,
I have a panel defined like that :
[java]
<panel id=“mainPanel” height=“100%” width=“100%” childLayout=“overlay” visibleToMouse=“true” />
[/java]
And i want to retrieve it’s height and width in pixel.
[java]
element.getWidth() = 0
element.getConstraintWidth() = “100%”
element.getHeight() = 0
element.getConstraintHeight() = “100%”
[/java]
How do I get it’s actual size ?
( I think I saw something about that in the forum one month ago but I can’t find it. Sorry for the double post if it’s the case xD )
Thanks in advance
element.getWidth() and element.getHeight() should return the actual size! It’s odd that it does not work in your case. What childLayout does the parent panel use? Is this a regular panel or is this part of some dynamic element or something?
What helps sometimes is to log the Nifty screen. There is a screen.debugOutput() method that returns a String that shows the complete tree of all elements and their width/height/properties/you name it This might help in tracking down the issue, I think.
My bad. It works
Thanks for giving me the tip of screen.debugOutput(), it will help me a lot.
Don’t know why I thought that. Perhaps the time I tried to do it there was a problem but not anymore… Sorry xD
It was for creating multiline texts but it seems you have done something about that.
I will create an other post if I still have problem with Nifty 1.3.
( I tried to simply use nifty1.3-SNAPSHOT with JME3 nightly build ut it doesn’t work, so I will wait for JME to create a nightly build with JME3 before testing that again. )