Jump to content

Should i share my GUI api (JavaFX)?


PolishCivil

  

9 members have voted

  1. 1. Ye/No

    • Ye
      6
    • No
      3


Recommended Posts

Im asking you guys cuz idk if someone actually need it.

INFO:

So basically you can make your gui in java fx which looks cool (alot better than awt imo).
But at start there might be problem with syncing your gui with script/states because for example if you want to use fxml loader (the .fxml files) with controller class, each time you load your gui with fxloader it makes your controler unique (new instance) so if you for example want to make 1 controler for whole gui with all childs you wont succeed with JavaFX API (i think, I've been searching on google for solution - no results)

So generally use of my api is :

 

2014-05-30_10-30-26.png

 

FXGUI -

2014-05-30_10-32-43.png

 

FXGUIContextBuilder:

 

2014-05-30_10-34-39.png

2014-05-30_10-35-15.png

 

FXGUIContext:

 

2014-05-30_10-36-18.png

FXGUIController:

 

This is your main controller, which you share between childs like:

2014-05-30_10-38-31.png

^ this is main gui
2014-05-30_10-41-12.png
^and exact one for gui childs

 

Now, if you want to open new child u simply:

2014-05-30_10-42-55.png

 

"Region preview" is just new frame title.
"regionview.fxml" is the fx design file for my region preview.

 

So generally you can store FXGUIContext somewhere in your script, and after closing your main gui you can use it as settings holder like;
 


fight(){
npc.getForName(script.context.choosedNpcName).interact("Attack");
}

2014-05-30_10-50-55.png

Edited by PolishCivil
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...