Modify Nify TextField Style

As I understand, we can overide Nifty Control Style right ???



However , when I try define mystyle like this

[xml]

<style id="mystyle#text" base="nifty-textfield#text">

<attributes font="Fonts/Segou_UI_Symbol_24.fnt"/>

</style>



<control name="textfield" text="Server-IP" valign="center" style="mystyle" > </control>

[/xml]

its error

[java]

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.RuntimeException: missing childLayout attribute for an element with [1] child elements. Attributes of error element [style => #field, visibleToMouse => true, id => #field]

at de.lessvoid.nifty.loaderv2.types.ElementType.enforceChildLayout(ElementType.java:187)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:176)

at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyChildren(ElementType.java:251)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:175)

at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyChildren(ElementType.java:251)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:175)

at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyChildren(ElementType.java:251)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:175)

at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyChildren(ElementType.java:251)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:175)

at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyChildren(ElementType.java:251)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:175)

at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)

at de.lessvoid.nifty.Nifty.createPopupFromType(Nifty.java:812)

at de.lessvoid.nifty.Nifty.createAndAddPopup(Nifty.java:863)

at de.lessvoid.nifty.Nifty.createPopup(Nifty.java:838)

at v3l.scene.MainScene.bind(MainScene.java:25)

at de.lessvoid.nifty.screen.Screen.startScreen(Screen.java:208)

at de.lessvoid.nifty.Nifty.gotoScreenInternal(Nifty.java:618)

at de.lessvoid.nifty.Nifty.access$300(Nifty.java:73)

at de.lessvoid.nifty.Nifty$1.perform(Nifty.java:592)

at de.lessvoid.nifty.screen.Screen$EndScreenEndNotify.perform(Screen.java:654)

at de.lessvoid.nifty.screen.Screen$LocalEndNotify.perform(Screen.java:611)

at de.lessvoid.nifty.screen.Screen.startLayers(Screen.java:268)

at de.lessvoid.nifty.screen.Screen.endScreen(Screen.java:229)

at de.lessvoid.nifty.Nifty.gotoScreen(Nifty.java:589)

at v3l.scene.loader.MainSceneLoader.onLoadingCompleted(MainSceneLoader.java:19)

at v3l.scene.loader.SceneLoader.update(SceneLoader.java:83)

at com.jme3.app.state.AppStateManager.update(AppStateManager.java:249)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:255)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:182)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at java.lang.Thread.run(Thread.java:722)

[/java]



So could any one explain why ?

Thanks in advance :slight_smile:

Now I know that I must overide all of # right ??



However, when I try to Modify the font of #text or the alignment of #text . It doesn’t work





Is there a way to do that ???



Thanks