Hi! I need some help with the GUI design.
To create a window we need to:
1) Create a new class that extends UIDisplayWindow
2) Inside a constructor add interface elements along with their size, disposition and action they perform
3) Create an instance of this class and add in to the GUIManager.
I think it's wrong. My suggestion is:
Windows generation will rely on three files.
1) UI<WindowName>Window.xml contains window description along with ui
elements descriptions, e.g. id, disposition and size. If we need to attach an action to the particular element, we just add "on" attributes such as onMouseClick, onMouseOver, OnKeyUp, etc. Attribute names here are names of corresponding methods.
2) UI<WindowName>Window.css contains styles (background, position, size, text color, background color, borders, etc)
3) UI<WindowName>Window.groovy contains a class UI<WindowName>WindowAction which methods are actions for the ui elements in this window. Once the game starts, GUIWindowsBuilder relying on this files generates UIDisplayWindows and add them into the GUIManager.
What do u think?
UPD 1. JSON might be replacing XML files
To create a window we need to:
1) Create a new class that extends UIDisplayWindow
2) Inside a constructor add interface elements along with their size, disposition and action they perform
3) Create an instance of this class and add in to the GUIManager.
I think it's wrong. My suggestion is:
Windows generation will rely on three files.
1) UI<WindowName>Window.xml contains window description along with ui
elements descriptions, e.g. id, disposition and size. If we need to attach an action to the particular element, we just add "on" attributes such as onMouseClick, onMouseOver, OnKeyUp, etc. Attribute names here are names of corresponding methods.
2) UI<WindowName>Window.css contains styles (background, position, size, text color, background color, borders, etc)
3) UI<WindowName>Window.groovy contains a class UI<WindowName>WindowAction which methods are actions for the ui elements in this window. Once the game starts, GUIWindowsBuilder relying on this files generates UIDisplayWindows and add them into the GUIManager.
What do u think?
UPD 1. JSON might be replacing XML files