@@ -8,35 +8,78 @@ new Display("title",%BufferSize%,%OnDisplayRect%)
8
8
```
9
9
BufferSize is 2 is Double Buffer. 3 is Triple Buffer.
10
10
OnDisplayRect will decide Window Pos and Size
11
+ ### Layer
12
+ layer allows you easy operation.
11
13
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
+ ```
12
19
### Drawable
13
20
``` 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 )
15
27
```
16
- Default Drawable supported Image,String.
17
28
18
- and Drawable register to Display,
29
+ ### SyncedDrawable
30
+ If You Want to Changed State of Drawable,It's not hard.
31
+
19
32
``` Java
20
- Display . addDrawable(drawable )
33
+ new Drawable ( new Synced ...() )
21
34
```
22
35
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
+ ```
24
48
49
+ It will draw "After Change",(Because It was Changed!)
25
50
26
51
#### CustomDrawable
27
52
if you want make CutomDrawable,
28
- you must implement ICustomDrawable
53
+ you must implement IDrawable
29
54
``` Java
30
- public class test_cutom_Drawable implments ICustomDrawable {
31
- @Override
55
+ public class test_cutom_Drawable implments IDrawable {
56
+ @Override
32
57
public void onDraw (Graphics g , Rect rect ) {
33
58
// To SomeThing draw.
34
59
}
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
+ }
35
77
}
36
78
```
79
+
37
80
and Use this for
38
81
``` Java
39
- new Drawable (new test_custom_Drawable(), new Pos (), " id " )
82
+ layer . addDrawable (new test_custom_drawable());
40
83
```
41
84
42
85
You can add own Drawable!
@@ -53,22 +96,38 @@ new GUIBase("test",new Pos(),"id")
53
96
54
97
and register,
55
98
``` Java
56
- Display . addGUI( Gui )
99
+ Display . addDrawable( new Drawable ( GUIBase ) )
57
100
```
58
- ** if You Changed state,you must register now!**
59
101
60
102
#### CustomGUI
61
103
if you want make CutomGUI,
62
- you must implement ICustomGUI
104
+ you must implement IDrawable.
105
+
63
106
``` Java
64
- public class test_cutom_GUI implments ICustomGUI {
107
+ public class test_cutom_GUI implments IDrawable {
65
108
@Override
66
109
public void onDraw (Graphics g , Rect rect ) {
67
110
// To SomeThing draw.
68
111
}
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
+ }
69
128
}
70
129
```
71
130
and Use this for
72
131
``` Java
73
- new GUIBase (new test_custom_GUI(), new Pos (), " id " )
132
+ new Drawable (new test_custom_GUI())
74
133
```
0 commit comments