Posted 16 April 2014 - 07:36 AM
This api is used in Craftdroid (see link below the 'old post')
It creates dialog boxes, or pop-ups.
You can use this api for creating great UIs.
Please if you creates an app with this show me in credits or give a link to this page, thanks.
Old post:
This API makes dialog boxes, it's simple and easy.(current version: 1.2)
You can create 3 types of dialog boxes:
-Error dialog box
-Yes or no dialog box
-Accept or cancel dialog box
Download:
New functions:
errdialog(x,y,text)
X,Y->coordinates of dialog box
Text-> text in dialog box, it must be 15 or less characters long.
Buttons: OK -returns nil
yesorno(x,y,txt,title)
X,Y->coordinates
Title->title of dialog box
Text->text in dialog box
Both must be 15 or less characters long
Buttons:
Yes-returns true Note: not "true" but true-boolean value
No-returns false
acceptdia(x,y,txt,title)
x,y->coordianates
Title and txt->title and txt in dialogbox
Buttons: X-to close,returns false
Accept-returns true
cleardia(type,x,y)
type->1:error2:yesorno3:accept
Note: This function runs automatically when you click on OK/YES/NO/X/ACCEPT
To turn off this function open edit diaapi and at the 4. line you can see "config" and doesclear = true.
Change true to false to disable auto-clearing dialog boxes when clicking on a button.Example code:
Coming soon:
-Retry/ignore dialog boxes
-Manual dialog boxes
-Dialog Boxes will movable
For example:
Diaapi.manualdialog(beginx,endx,beginy,endy,type,title,txt,colorset)
-color sets(blue-white is yet, and green-yellow and red-white comes
Note: I found a bug in accept dialogs: the 'accept' button don't works (big bug), when I release the new version, there will this bug removed.
Thanks!
the version 1.2.1 is out only for CraftDroid users!
link: http://www.computerc...357-craftdroid/
It creates dialog boxes, or pop-ups.
You can use this api for creating great UIs.
Please if you creates an app with this show me in credits or give a link to this page, thanks.
Old post:
Spoiler
Hi!This API makes dialog boxes, it's simple and easy.(current version: 1.2)
You can create 3 types of dialog boxes:
-Error dialog box
-Yes or no dialog box
-Accept or cancel dialog box
Download:
Spoiler
pastebin get 39hevtHr diaAPISpoiler
This api has 4 functions:errdialog(x,y,text)
X,Y->coordinates of dialog box
Text-> text in dialog box, it must be 15 or less characters long.
Buttons: OK -returns nil
yesorno(x,y,txt,title)
X,Y->coordinates
Title->title of dialog box
Text->text in dialog box
Both must be 15 or less characters long
Buttons:
Yes-returns true Note: not "true" but true-boolean value
No-returns false
acceptdia(x,y,txt,title)
x,y->coordianates
Title and txt->title and txt in dialogbox
Buttons: X-to close,returns false
Accept-returns true
cleardia(type,x,y)
type->1:error2:yesorno3:accept
Note: This function runs automatically when you click on OK/YES/NO/X/ACCEPT
To turn off this function open edit diaapi and at the 4. line you can see "config" and doesclear = true.
Change true to false to disable auto-clearing dialog boxes when clicking on a button.
Spoiler
os.loadAPI("diaAPI")
diaAPI.errdialog(4,4,"test") --this creates an error dialog with text 'test'
Variable = diaAPI.yesorno(2,5,"title","text in box")
If variable == true then
Print("you clicked on yes!")
End
Spoiler
This will be in diaapi 1.3-Retry/ignore dialog boxes
-Manual dialog boxes
For example:
Diaapi.manualdialog(beginx,endx,beginy,endy,type,title,txt,colorset)
-color sets(blue-white is yet, and green-yellow and red-white comes
Note: I found a bug in accept dialogs: the 'accept' button don't works (big bug), when I release the new version, there will this bug removed.
Thanks!
the version 1.2.1 is out only for CraftDroid users!
link: http://www.computerc...357-craftdroid/
Edited on 12 May 2014 - 11:18 AM