Semi-broken Nifty with last updates

Well… I’m unsure what you expect really. The basic screen at the start of the game with a background image, some other images for each menu option (start, option, quit, etc) don’t even show their hints. Only the hint panel is visible, the text isn’t.



Short of providing you the whole screen all I can suggest is to try with a nifty hint? If that doesn’t work, I’ll send you the whole XML file.



Ex. of hint usage:

[xml]

<image id=“mnuGenGalaxy” filename=“Textures/GUI/Generate4.png” x=“690” y=“475” width=“225” height=“133” >

<effect>

<onHover name=“hint” hintText="${dialog.NewGalaxyHint}" hintDelay=“250” />

</effect>

<interact onClick=“doNothing()” onRelease=“startIt()”/>

</image>

[/xml]

I loaded the all/intro.xml file in nifty examples jar and the hints demo works fine for me… I am using the latest version of nifty though.

Ran the example and it also runs fine here, so… Yeah.



Here’s the main screens when you start the game. The first screen is what gets displayed by default, the second is the option screen. Each and every option text is absent, rendered underneath… so all you can see is controls but no text.



[xml]

<?xml version=“1.0” encoding=“UTF-8”?>

<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd”>



<registerSound id=“beep” filename=“Sounds/Effects/beep.ogg” />

<registerSound id=“beep2” filename=“Sounds/Effects/beep2.ogg” />

<resourceBundle id=“dialog” filename=“Interface/dialog” />



<!-- progressbar -->

<controlDefinition name=“progressbar” controller=“com.madjack.games.disenthral.gui.nifty.ProgBarControl”>

<image filename=“Textures/GUI/progressbar-outer.png” imageMode=“resize:15,2,15,15,15,2,15,2,15,2,15,15” childLayout=“absolute”>

<image id=“progress” x=“0” y=“0” filename=“Textures/GUI/progressbar-inner.png” width=“32px” height=“100%” imageMode=“resize:15,2,15,15,15,2,15,2,15,2,15,15” />

<text id=“progressText” font=“Fonts/segoe_UI_semibold_18.fnt” text="" textHAlign=“center” textVAlign=“center” width=“100%” height=“100%” x=“0” y=“0” color="#f00f" />

</image>

</controlDefinition>



<useStyles filename=“nifty-default-styles.xml” />

<useControls filename=“nifty-default-controls.xml” />



<screen id=“loadingScreen” controller=“com.madjack.games.disenthral.gui.nifty.Screens”>

<layer id=“topLayer” childLayout=“vertical” textVAlign=“center” backgroundImage=“Textures/GUI/background.png” visibleToMouse=“true”>

<panel id=“welcome” padding=“10px,0,0,0” height=“10%” width=“75%” align=“center” valign=“top” childLayout=“center” visibleToMouse=“true”>

<control name=“label” width=“100%” id=“welcome_text” color="#ffff" font=“Fonts/segoe_UI_semibold_32.fnt” text="${dialog.welcome}" align=“center” valign=“top” />

</panel>

<panel id=“hint” padding=“10px,0,0,0” height=“5%” width=“75%” align=“center” valign=“top” childLayout=“vertical” visibleToMouse=“true”>

<control name=“label” width=“100%” id=“hint_text” font=“Fonts/segoe_UI_semibold_24.fnt” text="${dialog.hintText}" color="#ffff" align=“center” valign=“center” />

</panel>

</layer>

<layer id=“progressBarLayer” childLayout=“vertical” padding=“150px,0px,0,0” align=“center” width=“100%”>

<control id=“my-progress” name=“progressbar” align=“center” valign=“center” width=“400px” height=“32px” />

</layer>

<layer id=“nothing” childLayout=“absolute”>

<panel id=“menuCreateGalaxy” childLayout=“absolute” width=“300” height=“133” visibleToMouse=“true”>

<image id=“mnuGenGalaxy” filename=“Textures/GUI/Generate4.png” x=“690” y=“475” width=“225” height=“133” >

<effect>

<onHover name=“hint” hintText="${dialog.NewGalaxyHint}" hintDelay=“250” />

</effect>

<interact onClick=“doNothing()” onRelease=“startIt()”/>

</image>

</panel>

<panel id=“menuSaveGame” childLayout=“absolute” width=“300” height=“133” visibleToMouse=“true”>

<image filename=“Textures/GUI/Save1.png” x=“330” y=“125” width=“200” height=“150” >

<effect>

<onHover name=“hint” hintText="${dialog.SaveGameHint}" hintDelay=“250” />

</effect>

<interact onClick=“doNothing()” onRelease=“saveGame()”/>

</image>

</panel>

<panel id=“menuLoadGame” childLayout=“absolute” width=“300” height=“133” visibleToMouse=“true”>

<image filename=“Textures/GUI/Load1.png” x=“250” y=“350” width=“200” height=“150” >

<effect>

<onHover name=“hint” hintText="${dialog.LoadGameHint}" hintDelay=“250” />

</effect>

<interact onClick=“doNothing()” onRelease=“loadGame()”/>

</image>

</panel>

<panel id=“menuConfig” childLayout=“absolute” width=“300” height=“133” visibleToMouse=“true”>

<image filename=“Textures/GUI/Options1.png” x=“680” y=“75” width=“200” height=“150” >

<effect>

<onHover name=“hint” hintText="${dialog.OptionsHint}" hintDelay=“250” />

</effect>

<interact onRelease=“optionsScreen()”/>

</image>

</panel>

<panel id=“menuQuit” childLayout=“absolute” width=“131” height=“64” visibleToMouse=“true”>

<image filename=“Textures/GUI/Quit1.png” x=“1139” y=“646” width=“131” height=“64” >

<effect>

<onHover name=“hint” hintText="${dialog.QuitHint}" hintDelay=“250” />

</effect>

<interact onClick=“doNothing()” onRelease=“bye()”/>

</image>

</panel>

</layer>

</screen>



<screen id=“optionsScreen” controller=“com.madjack.games.disenthral.gui.nifty.Options”>

<layer backgroundColor="#003f" childLayout=“center”>

<panel style=“nifty-panel” width=“95%” height=“95%” align=“center” valign=“center” childLayout=“center”>

<panel style=“nifty-panel” width=“100%” height=“100%” childLayout=“vertical” visibleToMouse=“false”>

<panel style=“nifty-panel” width=“100%” height=“25%” childLayout=“horizontal” visibleToMouse=“false”>

<panel width=“50%” height=“100%” childLayout=“vertical” visibleToMouse=“false”>

<!-- ============== -->

<!-- Media Settings -->

<!-- ============== -->

<control name=“label” text="${dialog.mediaPanelTitle}" width=“100%” height=“40px” textHAlign=“left” textVAlign=“top” font=“Fonts/segoe_UI_semibold_32.fnt” />

<panel width=“100%” height=“50px” valign=“bottom” childLayout=“horizontal” visibleToMouse=“false”>

<control name=“label” text="${dialog.sounds}: " width=“120px” textHAlign=“right”/>

<control name=“checkbox” id=“soundsChkbox” align=“left” visibleToMouse=“true”>

<effect>

<onHover name=“hint” hintText="${dialog.soundOption}" hintDelay=“250” />

</effect>

</control>

<control id=“soundVolume” name=“label” text=“100%” width=“100px” />

<control id=“soundSlider” name=“horizontalSlider” width=“300px” initial=“100” buttonStepSize=“10” />

</panel>

<panel height=“50px” valign=“bottom” childLayout=“horizontal” visibleToMouse=“false”>

<control name=“label” text="${dialog.music}: " width=“120px” textHAlign=“right”/>

<control name=“checkbox” id=“musicChkbox” align=“left” visibleToMouse=“true” >

<interact onClick=“musicCheck()”/>

<effect>

<onHover name=“hint” hintText="${dialog.musicOption}" hintDelay=“250” />

</effect>

</control>

<control id=“musicVolume” name=“label” text=“100%” width=“100px”/>

<control id=“musicSlider” name=“horizontalSlider” width=“300px” initial=“100” buttonStepSize=“10” />

</panel>

</panel>

<!-- ============ -->

<!-- GFX Settings -->

<!-- ============ -->

<panel width=“50%” height=“100%” childLayout=“vertical” valign=“top” visibleToMouse=“false”>

<control name=“label” text="${dialog.graphicPanelTitle}" width=“100%” height=“40px” textHAlign=“left” textVAlign=“top” font=“Fonts/segoe_UI_semibold_32.fnt” />

<panel width=“100%” height=“50%” childLayout=“horizontal” visibleToMouse=“false”>

<control name=“label” text="${dialog.resolutions}: " align=“left” />

<control id=“resolutionsDropDown” name=“dropDown” width=“250px” visibleToMouse=“true”>

<effect>

<onHover name=“hint” hintText="${dialog.ResolutionsOption}" hintDelay=“250” />

</effect>

</control>

<panel childLayout=“vertical”>

<control name=“label” text="${dialog.imageQuality}" />

<panel childLayout=“vertical”>

<control id=“aaRadio” name=“radioButtonGroup” />

<panel childLayout=“horizontal”>

<control name=“label” text="${dialog.AA}" width=“75px” textHAlign=“right” />

<control name=“radioButton” id=“AA” group=“aaRadio”>

<effect>

<onHover name=“hint” hintText="${dialog.AAOption}" hintDelay=“250” />

</effect>

</control>

<control name=“dropDown” id=“AAnumberDropDown” width=“50px” />

</panel>

<panel childLayout=“horizontal”>

<control name=“label” text="${dialog.FXAA}" width=“75px” textHAlign=“right” />

<control name=“radioButton” id=“FXAA” group=“aaRadio”>

<effect>

<onHover name=“hint” hintText="${dialog.FXAAOption}" hintDelay=“250” />

</effect>

</control>

</panel>

<panel childLayout=“horizontal”>

<control name=“label” text="${dialog.none}" width=“75px” textHAlign=“right” />

<control name=“radioButton” id=“None” group=“aaRadio” />

</panel>

</panel>

</panel>

</panel>

<panel width=“100%” height=“40%” childLayout=“horizontal” visibleToMouse=“false”>

<control name=“label” text="${dialog.fullscreen}: " align=“left” textHAlign=“right”/>

<control id=“fullscreenChkbox” name=“checkbox”>

<effect>

<onHover name=“hint” hintText="${dialog.FullScreenOption}" hintDelay=“250” />

</effect>

</control>

<panel width=“5px” />

<control name=“label” text="${dialog.lensflare}: " align=“left” textHAlign=“right”/>

<control id=“lensflareChkbox” name=“checkbox”>

<effect>

<onHover name=“hint” hintText="${dialog.FlareOption}" hintDelay=“250” />

</effect>

</control>

<panel width=“5px” />

<control name=“label” text="${dialog.glow}: " align=“left” textHAlign=“right”/>

<control id=“glowChkbox” name=“checkbox”>

<effect>

<onHover name=“hint” hintText="${dialog.GlowOption}" hintDelay=“250” />

</effect>

</control>

</panel>

</panel>

</panel>

<!-- ============= -->

<!-- Game Settings -->

<!-- ============= -->

<panel style=“nifty-panel” width=“100%” height=“25%” align=“left” valign=“top” childLayout=“vertical” visibleToMouse=“false”>

<control name=“label” text="${dialog.gamePanelTitle}" width=“100%” height=“40px” textHAlign=“left” textVAlign=“top” font=“Fonts/segoe_UI_semibold_32.fnt” />

<control name=“label” text="${dialog.galaxySize}: " align=“left” />

<control id=“galaxySizeDropDown” name=“dropDown” width=“350px” visibleToMouse=“true”>

<effect>

<onHover name=“hint” hintText="${dialog.GalaxySizeOption}" hintDelay=“250” />

</effect>

</control>

</panel>

<!-- ================= -->

<!-- Key Bindings Area -->

<!-- ================= -->

<panel width=“100%” style=“nifty-panel” height=“50%” align=“right” valign=“bottom” childLayout=“vertical” visibleToMouse=“false”>

<control name=“label” text="${dialog.gameKeyBinding}" width=“100%” height=“40px” textHAlign=“left” textVAlign=“top” font=“Fonts/segoe_UI_semibold_32.fnt” />

<panel childLayout=“horizontal”>

<panel childLayout=“vertical” width=“150px” align=“left”>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“pitchDown” text="${dialog.pitchDown}" textHAlign=“left” width=“90px”>

<interact onClick=“pitchDownEnable()” />

</control>

<control name=“textfield” id=“pitchDownKey” width=“50px” textHAlign=“center” align=“right”>

<interact onLostFocus=“pitchDownSave()” />

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“pitchUp” text="${dialog.pitchUp}" textHAlign=“left” width=“90px”>

<interact onClick=“pitchUpEnable()”/>

</control>

<control name=“textfield” id=“pitchUpKey” width=“50px” textHAlign=“center” align=“right”>

<interact onLostFocus=“pitchUpSave()” />

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“turnLeft” text="${dialog.turnLeft}" textHAlign=“left” width=“90px”>

<interact onClick=“turnLeftEnable()”/>

</control>

<control name=“textfield” id=“turnLeftKey” width=“50px” textHAlign=“center” align=“right”>

<interact onLostFocus=“turnLeftSave()” />

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“turnRight” text="${dialog.turnRight}" textHAlign=“left” width=“90px”>

<interact onClick=“turnRightEnable()”/>

</control>

<control name=“textfield” id=“turnRightKey” width=“50px” textHAlign=“center” align=“right”>

<interact onLostFocus=“turnRightSave()”/>

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“rollLeft” text="${dialog.rollLeft}" textHAlign=“left” width=“90px”>

<interact onClick=“rollLeftEnable()”/>

</control>

<control name=“textfield” id=“rollLeftKey” width=“50px” textHAlign=“center” align=“right”>

<interact onLostFocus=“rollLeftSave()”/>

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“rollRight” text="${dialog.rollRight}" textHAlign=“left” width=“90px”>

<interact onClick=“rollRightEnable()”/>

</control>

<control name=“textfield” id=“rollRightKey” width=“50px” textHAlign=“center” align=“right”>

<interact onLostFocus=“rollRightSave()”/>

</control>

</panel>

<panel childLayout=“absolute”>

<panel childLayout=“center” x=“0” y=“5”>

<control name=“button” id=“resetBindings” width=“150px” label=“Reset Bindings” align=“center”>

<interact onRelease=“resetBindings()”/>

</control>

</panel>

</panel>

</panel>

<panel width=“5px”/>

<panel childLayout=“vertical” width=“175px” align=“left”>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“fullSpeed” text="${dialog.fullSpeed}" textHAlign=“left” width=“90px”>

<interact onClick=“fullSpeedEnable()”/>

</control>

<control name=“textfield” id=“fullSpeedKey” text="" width=“75px” textHAlign=“center” align=“right”>

<interact onLostFocus=“fullSpeedSave()”/>

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“pauseSpeed” text="${dialog.pauseSpeed}" textHAlign=“left” width=“90px”>

<interact onClick=“pauseSpeedEnable()”/>

</control>

<control name=“textfield” id=“pauseSpeedKey” text="" width=“75px” textHAlign=“center” align=“right”>

<interact onLostFocus=“pauseSpeedSave()”/>

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“stopSpeed” text="${dialog.stopSpeed}" textHAlign=“left” width=“90px”>

<interact onClick=“stopSpeedEnable()”/>

</control>

<control name=“textfield” id=“stopSpeedKey” text="" width=“75px” textHAlign=“center” align=“right”>

<interact onLostFocus=“stopSpeedSave()”/>

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“stepUpSpeed” text="${dialog.stepUpSpeed}" textHAlign=“left” width=“90px”>

<interact onClick=“speedUpEnable()”/>

</control>

<control name=“textfield” id=“stepUpSpeedKey” text="" width=“75px” textHAlign=“center” align=“right”>

<interact onLostFocus=“stepUpSpeedSave()”/>

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“stepDownSpeed” text="${dialog.stepDownSpeed}" textHAlign=“left” width=“90px”>

<interact onClick=“speedDownEnable()”/>

</control>

<control name=“textfield” id=“stepDownSpeedKey” text="" width=“75px” textHAlign=“center” align=“right”>

<interact onLostFocus=“stepDownSpeedSave()”/>

</control>

</panel>

<panel height=“2px”/>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“overview” text="${dialog.overview}" textHAlign=“left” width=“90px”>

<interact onClick=“overviewEnable()”/>

</control>

<control name=“textfield” id=“overviewKey” text="" width=“75px” textHAlign=“center” align=“right”>

<interact onLostFocus=“overviewSave()”/>

</control>

</panel>

<panel childLayout=“horizontal” width=“150px” align=“right”>

<control name=“label” id=“outlines” text="${dialog.outlines}" textHAlign=“left” width=“90px”>

<interact onClick=“outlinesEnable()”/>

</control>

<control name=“textfield” id=“outlinesKey” text="" width=“75px” textHAlign=“center” align=“right”>

<interact onLostFocus=“outlinesSave()”/>

</control>

</panel>

</panel>

</panel>

<panel height=“35px”/>

<panel width=“100%” height=“15%” align=“right” valign=“bottom” childLayout=“horizontal” visibleToMouse=“false”>

<control id=“saveSettings” type=“button” label="${dialog.save}" align=“center” visibleToMouse=“true”>

<interact onClick=“saveSettings()”/>

<effect>

<onHover name=“hint” hintText="${dialog.SaveOption}" hintDelay=“250” />

<onHover name=“focus”/>

<onFocus name=“playSound” sound=“beep2”/>

<onClick name=“playSound” sound=“beep”/>

</effect>

</control>

<panel width=“10px” />

<control id=“applySettings” type=“button” label="${dialog.apply}" align=“center” visibleToMouse=“true”>

<interact onClick=“applySettings()”/>

<effect>

<onHover name=“hint” hintText="${dialog.ApplyOption}" hintDelay=“250” />

<onHover name=“focus”/>

<onFocus name=“playSound” sound=“beep2”/>

<onClick name=“playSound” sound=“beep”/>

</effect>

</control>

<panel width=“10px” />

<control id=“cancel” type=“button” label="${dialog.cancel}" align=“center” visibleToMouse=“true”>

<interact onClick=“cancelSettings()”/>

<effect>

<onHover name=“hint” hintText="${dialog.CancelOption}" hintDelay=“250” />

<onHover name=“focus”/>

<onFocus name=“playSound” sound=“beep2”/>

<onClick name=“playSound” sound=“beep”/>

</effect>

</control>

</panel>

</panel>

</panel>

</panel>

</layer>

</screen>



<popup id=“popupExit” childLayout=“center” backgroundColor="#000a">

<effect>

<onStartScreen name=“fade” startColor="#0000" endColor="#000a" length=“500” />

<onStartScreen name=“playSound” sound=“popup” startDelay=“600” />

<onEndScreen name=“fade” startColor="#000a" endColor="#0000" length=“500” startDelay=“250” />

</effect>

<panel style=“nifty-panel-red” childLayout=“center” padding=“18px,28px,40px,16px” width=“30%” height=“20%” align=“center” valign=“center”>

<effect>

<onStartScreen name=“fade” start="#0" end="#f" length=“150” startDelay=“250”/>

<onStartScreen name=“imageSize” timeType=“exp” factor=“3.5” startSize=“1.5” endSize=“1.0” inherit=“true” length=“150” startDelay=“250”/>

<onEndScreen name=“fade” start="#f" end="#0" length=“150” startDelay=“0”/>

<onEndScreen name=“imageSize” timeType=“exp” factor=“3.5” startSize=“1.0” endSize=“1.5” inherit=“true” length=“150” startDelay=“0”/>

</effect>

<panel childLayout=“vertical” align=“center” valign=“center”>

<effect>

<onStartScreen name=“alphaHide” length=“700” inherit=“true” />

<onEndScreen name=“fade” length=“10” start="#f" end="#0" inherit=“true” />

</effect>

<panel childLayout=“center” height=“70%” width=“100%”>

<control name=“label” text="${dialog.exitConfirm}" style=“base-font” align=“center” valign=“center” color="#000f"/>

</panel>

<panel childLayout=“horizontal” align=“center” height=“30%”>

<panel childLayout=“center” width=“50%”>

<control id=“yesButton” name=“button” label="${dialog.dlgYes}" width=“100px” align=“center”>

<interact onRelease=“popupExit(yes)” />

</control>

</panel>

<panel childLayout=“center” width=“50%”>

<control id=“noButton” name=“button” label="${dialog.dlgNo}" width=“100px” align=“center”>

<interact onRelease=“popupExit(no)” />

</control>

</panel>

</panel>

</panel>

</panel>

</popup>



</nifty>

[/xml]

@madjack said:
Sorry for the delay.

The map area seen in the previous posts are not part of Nifty. They are quads. Nifty's stuff is drawn above it, but the bitmap text (Nifty's labels, etc) has its depth wrong vs nifty elements' (panels) depth.

That's exactly the issue I'm having right now.
Did you make any progress?

http://hub.jmonkeyengine.org/groups/gui/forum/topic/nifty-problem-while-using-multiple-viewports/

I’ve tried nifty 1.3.1 and the issue is still there

@Momoko_Fan said he knew what the problem was and was working on a fix. With what I provided I imagine he has all he needs to do just that. If not I’m sure he’ll reply here and ask for more info.



Just be patient. :slight_smile:

I think we’ve been patient for a long time now. Please an update on this @Momoko_Fan?



Thanks.

@madjack: Should be fixed now

1 Like

The text is still rendered behind nifty’s quads. In short, no change.

My apologies @momoko_Fan as it seems the issue is indeed fixed.



For some reason the engine’s source files hadn’t been updated… Not sure how that happened but as I updated to day I noticed there was a LOT of files changes which hinted that something had gone wrong before. Maybe I’m just being forgetful, old age and everything.



Anyway. Thanks.

1 Like

OK, saves me from having to test it again :slight_smile:

1 Like