Nifty Gui – Custom Attributes

Is there a way to inject custom properties in a nifty Element…control or a screen at worst?



Let me explain what i want to do : I have a gui which is completly customisable by the users…they can move and scale all the elements of the interface in order to make it as personalized as possible (as do wow, rift, swtor for example). Until the everything works fine, but I’d now like to (always like current MMO standards) allow the user to select a transparency value for certain items such as map when the player moves … when he enters combat etc …



I wanted to set for each Element, defaults values on which I could have my support for calculating ratios or restore the standard model for example.



Is it possible when creating the interface to specify custom parameters like : defautlSize = “10%”, fadePercentInMove = “0.5f” or booleans to know at the start of a fight if the current item (in a loop checking all the interface) is to hide or not …

Maybe injecting a HashMap (String KeyWord, String Value) in each elements…or an other idea…

sure

http://freefr.dl.sourceforge.net/project/nifty-gui/nifty-gui/nifty-gui-the-manual-v1.0.pdf

Hmm, I guess you mean the variable ‘parameter’ which is recovered in the init method of the controller combined with the method parameter(String, String) in javaBuilder…I obviously already read the bible ^ ^ but we find no example where this method is used … so it doesn’t jump to the eyes.



Thank you Normen, I’ill look on that side. Rereading is needed: p

Page 64 or Page 18 in the Nifty Manual should help - although I didn’t fully understand the question :smiley: