@@ -8,35 +8,78 @@ new Display("title",%BufferSize%,%OnDisplayRect%)
88```
99BufferSize is 2 is Double Buffer. 3 is Triple Buffer.
1010OnDisplayRect will decide Window Pos and Size
11+ ### Layer
12+ layer allows you easy operation.
1113
14+ e.g. for get Layer from Display LayerManager
15+ ``` Java
16+ Display . layerManager. get(" %String id%" )
17+ Diaplay . layerManager. get(% Frame Layer Num % )
18+ ```
1219### Drawable
1320``` Java
14- new Drawable (" test" ,new Pos (10 ,40 )," for_id" )
21+ new Drawable (new IDrawable (% SomeThing % ))
22+ ```
23+
24+ and Drawable register to Display Layer.
25+ ``` Java
26+ Layer . addDrawable(Drawable )
1527```
16- Default Drawable supported Image,String.
1728
18- and Drawable register to Display,
29+ ### SyncedDrawable
30+ If You Want to Changed State of Drawable,It's not hard.
31+
1932``` Java
20- Display . addDrawable(drawable )
33+ new Drawable ( new Synced ...() )
2134```
2235
23- ** if You Changed state,you must register now!**
36+ IDrawable which is name starts with "Synced",It Supports dynamic Value Changing.
37+
38+ e.g. SyncedStringDrawable
39+
40+ ``` Java
41+ SyncedStringDrawable s_d= new SyncedStringDrawable (" Before Change" ,new Rect (100 ,100 ,200 ,200 )," id" );
42+ display. layerManager. get(" default" ). add(new Drawable (s_d));
43+ s_d. setText(" After Change" );
44+ while (true ){
45+ if (display. limiter. onUpdate()) display. update();
46+ }
47+ ```
2448
49+ It will draw "After Change",(Because It was Changed!)
2550
2651#### CustomDrawable
2752if you want make CutomDrawable,
28- you must implement ICustomDrawable
53+ you must implement IDrawable
2954``` Java
30- public class test_cutom_Drawable implments ICustomDrawable {
31- @Override
55+ public class test_cutom_Drawable implments IDrawable {
56+ @Override
3257 public void onDraw (Graphics g , Rect rect ) {
3358 // To SomeThing draw.
3459 }
60+
61+ @Override
62+ public Rect getShowingRect (){
63+ // Retrun border of Showing Content
64+ }
65+
66+ @Override
67+ public boolean isShowing (Display display ){
68+ // returns Is this showing.
69+ // Usually Use Display.isShowing(Rect rect)
70+ return display. isShowing(getShowingRect());
71+ }
72+
73+ @Override
74+ public String getID (){
75+ return " Drawable ID" ;
76+ }
3577}
3678```
79+
3780and Use this for
3881``` Java
39- new Drawable (new test_custom_Drawable(), new Pos (), " id " )
82+ layer . addDrawable (new test_custom_drawable());
4083```
4184
4285You can add own Drawable!
@@ -53,22 +96,38 @@ new GUIBase("test",new Pos(),"id")
5396
5497and register,
5598``` Java
56- Display . addGUI( Gui )
99+ Display . addDrawable( new Drawable ( GUIBase ) )
57100```
58- ** if You Changed state,you must register now!**
59101
60102#### CustomGUI
61103if you want make CutomGUI,
62- you must implement ICustomGUI
104+ you must implement IDrawable.
105+
63106``` Java
64- public class test_cutom_GUI implments ICustomGUI {
107+ public class test_cutom_GUI implments IDrawable {
65108@Override
66109 public void onDraw (Graphics g , Rect rect ) {
67110 // To SomeThing draw.
68111 }
112+
113+ @Override
114+ public Rect getShowingRect (){
115+ // Retrun border of Showing Content
116+ }
117+
118+ @Override
119+ public boolean isShowing (Display display ){
120+ // It is GUI,so We always draw it.
121+ return true ;
122+ }
123+
124+ @Override
125+ public String getID (){
126+ return " GUI ID" ;
127+ }
69128}
70129```
71130and Use this for
72131``` Java
73- new GUIBase (new test_custom_GUI(), new Pos (), " id " )
132+ new Drawable (new test_custom_GUI())
74133```
0 commit comments