Hi
I made a Panel with a Size in pixel.
I need this Panel to have the X positon: “100% - PANELSIZE”.
Making a panel stick to the top or left of the screen is no problem.
But I need it stuck to the bottom.
Niftys SizeValues dont seem to use the “-” Operator.
I cannot calculate the “100% - 128px” or so.
P.S. The Screen has a Layer. The Panel is in this Layer. ChildLayout of the Layer is Absolute.
This is a bit awkward to do at the moment. The work around I’ve been doing is using a parent panel or layer with vertical layout.
[xml]<panel childLayout=“vertical”>
<panel height=""/>
<panel YOUR PANEL HERE>
</panel>
</panel>
[/xml]
Panels of height "" always expand to fill the available space, that pushes the other down to the bottom.
You can use margins and/or padding to add space back at the bottom if you want a gap there.
Yes, “*” as height works when I use XML, but I am using Java.
In Java I have VARIABLES. This makes it so much easier!
Stupid me…
[java]int resolutionHeight = app.getViewPort().getCamera().getHeight();[/java]
then in Nifty, I create the panel with:
[java]y(resolutionHeight - 50 + “px”);[/java]
I need to think simpler about some problems…
Yeah, in Java it’s easy - you should have said