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
[attachment=1551:diaapi-yesornojpg.JPG][attachment=1552:diaapi-errdialogjpg.JPG]
Sorry, I can't upload larger files :mellow:/>
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, when I release the new version, in new version will this bug removed.
Thanks!
The desscription of older version:
Spoiler
Hello!This is my first API, I think it is a little bit useful, it can create dialog boxes with buttons.
Download: run
pastebin get 4xy0FmCi
It consists of 3 functions:
errdialog(x,y,text)
X,Y->coordinates of dialog box
Text-> text in dialog box, it must be 15 or less characters long.
yesorno(x,y,txt,title)
Returns:
Boolean(true -> clicked on yes)
X,Y->coordinates
Title->title of dialog box
Text->text in dialog box
Both must be 15 or less characters long
The third function is
cleardialog(x,y,type)
X,y->coordinates
Type->1-errordialog2-yesornodialog3-accept/canceldialog
Note:cleardialog runs automatically, to turn off this function open with editor diaAPI and at the 4th line you can see a boolean variable named doesclear:
doesclear = true
And set the value to false, and done