Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

69 Commits

Repository files navigation

Graphics

Graphics lib of NDSLib

Display

Display is made of JFrame(so Swing)

newDisplay("title",%BufferSize%,%OnDisplayRect%)

BufferSize is 2 is Double Buffer. 3 is Triple Buffer. OnDisplayRect will decide Window Pos and Size

Layer

layer allows you easy operation.

e.g. for get Layer from Display LayerManager

Display.layerManager.get("%String id%")
Diaplay.layerManager.get(%FrameLayerNum%)

Drawable

newDrawable(newIDrawable(%SomeThing%))

and Drawable register to Display Layer.

Layer.addDrawable(Drawable)

SyncedDrawable

If You Want to Changed State of Drawable,It's not hard.

newDrawable(newSynced...())

IDrawable which is name starts with "Synced",It Supports dynamic Value Changing.

e.g. SyncedStringDrawable

SyncedStringDrawables_d=newSyncedStringDrawable("Before Change",newRect(100,100,200,200),"id");
display.layerManager.get("default").add(newDrawable(s_d));
s_d.setText("After Change");
while(true){
if (display.limiter.onUpdate()) display.update();
}

It will draw "After Change",(Because It was Changed!)

CustomDrawable

if you want make CutomDrawable, you must implement IDrawable

publicclasstest_cutom_DrawableimplmentsIDrawable{
@OverridepublicvoidonDraw(Graphicsg, Rectrect) {
//To SomeThing draw.
}
@OverridepublicRectgetShowingRect(){
//Retrun border of Showing Content
}
@OverridepublicbooleanisShowing(Displaydisplay){
//returns Is this showing.//Usually Use Display.isShowing(Rect rect)returndisplay.isShowing(getShowingRect());
}
@OverridepublicStringgetID(){
return"Drawable ID";
}
} 

and Use this for

layer.addDrawable(newtest_custom_drawable());

You can add own Drawable! (DefaultCustomDrawables is LineDrawable,StringDrawable,PointDrawable)

GUI

The diffrence between GUI and Drawable is GUI always Draw. (EASY!)

To make;

newGUIBase("test",newPos(),"id")

and register,

Display.addDrawable(newDrawable(GUIBase))

CustomGUI

if you want make CutomGUI, you must implement IDrawable.

publicclasstest_cutom_GUIimplmentsIDrawable{
@OverridepublicvoidonDraw(Graphicsg, Rectrect) {
//To SomeThing draw.
}
@OverridepublicRectgetShowingRect(){
//Retrun border of Showing Content
}
@OverridepublicbooleanisShowing(Displaydisplay){
//It is GUI,so We always draw it.returntrue;
}
@OverridepublicStringgetID(){
return"GUI ID";
}
} 

and Use this for

newDrawable(newtest_custom_GUI())

About

Graphics lib of NDSLib

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages