ARSA Language  2.9
(Recursion, Encryption, GPU and Web 3.0)
operator.h
Go to the documentation of this file.
1 
142 
146 void arsalang(const char* src_name);
147 
149 
172 bool psd(const char* filename, bool clear = true, bool cache = true, bool snd = true);
173 
175 
195 bool openloading(const char* filename, bool only_psd = true);
196 
198 
201 void closeloading();
202 
204 
213 void textarea(const char* layername, const char* areaname, const char* string, int r = 255, int g = 255, int b = 255, int a = 255);
214 
216 
226 void textareafont(const char* layername, const char* areaname, const char* fontname, const char* string, int r = 255, int g = 255, int b = 255, int a = 255);
227 
229 
237 void textlayer(const char* layername, const char* string, int r = 255, int g = 255, int b = 255, int a = 255);
238 
240 
249 void textlayerfont(const char* layername, const char* fontname, const char* string, int r = 255, int g = 255, int b = 255, int a = 255);
250 
252 
257 void text(int x, int y, const char* string);
258 
260 
272 void textalign(int align);
273 
275 
285 void text(int x, int y, const char* string, int r, int g, int b, int a);
286 
288 
295 void text(const char* fontname, int fontsize, int x, int y, const char* string);
296 
298 
310 void text(const char* fontname, int fontsize, int x, int y, const char* string, int r, int g, int b, int a);
311 
313 
339 void int(const char* name, int value);
340 
342 
347 void gint(const char* name, int value);
348 
351 
356 void lint(const char* name, int value);
357 
359 
380 void float(const char* name, float value);
381 
383 
388 void gfloat(const char* name, float value);
389 
391 
396 void lfloat(const char* name, float value);
397 
399 
420 void string(const char* name, const char* value);
421 
423 
428 void gstring(const char* name, const char* value);
429 
431 
436 void lstring(const char* name, const char* value);
437 
439 
480 void struct(const char* name, const char* element, ...);
481 
483 
488 void gstruct(const char* name, int value);
489 
491 
495 void set(const char* name,const char* value);
496 
498 
502 void setstring(const char* name, const char* value);
503 
505 
509 void add(const char* name,const char* value);
510 
512 
516 void addstring(const char* name, const char* value);
517 
519 
523 void sub(const char* name,const char* value);
524 
526 
530 void mul(const char* name,const char* value);
531 
533 
537 void div(const char* name,const char* value);
538 
540 
544 void mod(const char* name,const char* value);
545 
547 
551 void _sin(const char* name,const char* value);
552 
554 
558 void _cos(const char* name,const char* value);
559 
561 
569 if(test_expr) void* function;
570 
572 
583 ifcount (const char* name, test_expr, int count ) void* function;
584 
586 
597 iftime(const char* name, test_expr, int delay) void* function;
598 
600 
603 void ifreset(const char* name = "");
604 
606 
616 void function(const char* name);
617 
619 
630 void procedure( void* function1 >> void* function2 >> ... >> void* functionN );
631 
633 void proc(void* function1 >> void* function2 >> ... >> void* functionN);
634 
636 
645 ifelse(test_expr, void* function1, void* function2);
646 
648 
664 for(init_expr; test_expr; increment_expr) void* function;
665 
667 
677 while(test_expr) void* function;
678 
680 
683 long gettime();
684 
686 
689 long getrealtime();
690 
692 
695 float getdeltatime();
696 
698 
701 int random();
702 
704 
709 int random(int min, int max);
710 
712 
716 const char* random_string(int len);
717 
719 
730 const char* random_guid(bool with_letter = false);
731 
733 
743 const char* random_string_custom(int len, const char* string_custom);
744 
746 
749 void setdebug(int debug);
750 
752 
755 int isdebug();
756 
758 
761 void msgbox(const char* msg);
762 
764 
774 void alog( const char* msg );
775 
777 
816 bool touch(const char* state);
817 
819 
826 void touch(const char* state, void* function);
827 
829 
837 bool touch(const char* state, const char* layername);
838 
840 
853 void touch(const char* state, const char* layername, void* function);
854 
856 
859 void touchclear();
860 
862 
865 int touchmax();
866 
868 
905 bool touchid(int touch_id, const char* state);
906 
908 
916 void touchid(int touch_id, const char* state, void* function);
917 
919 
928 bool touchid(int touch_id, const char* state, const char* layername);
929 
931 
940 void touchid(int touch_id, const char* state, const char* layername, void* function);
941 
943 
949 bool strstr(const char* string, const char* keyword);
950 
952 
982 const char* strtok(const char* string, const char* token = "");
983 
986 void return();
987 
990 void break();
991 
993 void continue();
994 
996 
999 void setgamefps(int fps);
1000 
1002 
1005 int getgamefps();
1006 
1008 
1011 int getcurrentfps();
1012 int getcurrentfps();
1013 
1015 
1019 void winsize(int width, int height);
1020 
1022 
1025 int getwinsizewidth();
1026 
1028 
1031 int getwinsizeheight();
1032 
1034 
1037 void setlandscape();
1038 
1040 
1043 void setportrait();
1044 
1046 
1053 float getzrot(float x1, float y1, float x2, float y2);
1054 
1056 
1062 void setbgcolor(int r, int g, int b, int a);
1063 
1065 
1068 const char* version();
1069 
1071 
1074 const char* getversion();
1075 
1077 
1080 const char* getredeemcode();
1081 
1083 
1086 const char* getuuid();
1087 
1089 
1092 const char* getpackage();
1093 
1095 
1105 const char* getplatform();
1106 
1108 
1111 void setuserstring(const char* str);
1112 
1114 
1117 const char* getuserstring();
1118 
1120 void exit();
1121 
1123 void clear();
1124 
1126 
1130 void drawonce( bool clear = false, bool updateall = false );
1131 
1133 
1145 bool url(const char* url, bool webapp = false , bool use_webbrowser = true);
1146 
1148 
1156 bool phonecall(const char* number);
1157 
1159 
1174 bool sharefile(const char* mailto, const char* subject, const char* msg, const char* filename);
1175 
1177 
1181 const char* savescreenshot( bool silent = false );
1182 
1184 
1194 bool sharescreenshot(const char* mailto, const char* subject, const char* msg);
1195 
1197 
1200 const char* getscreenshotname();
1201 
1203 
1207 const char* getgps();
1208 
1210 
1214 bool isset(const char* var );
1215 
1217 
1221 bool isnumber(const char* var);
1222 
1224 
1228 bool isint(const char* var);
1229 
1231 
1235 bool isfloat(const char* var);
1236 
1238 
1242 bool isstring(const char* var);
1243 
1245 
1249 bool isspace(const char* var);
1250 
1252 void clearqueuerender();
1253 
1255 void psdrenderall();
1256 
1260 
1263 const char* camera();
1264 
1266 
1274 bool pickup(const char* state, const char* layername);
1275 
1277 
1280 const char* pickupgetlayername();
1281 
1283 void pickupclear();
1284 
1286 
1290 const char* base64encode(const char* str);
1291 
1293 
1297 const char* base64decode(const char* str);
1298 
1300 
1304 const char* scanvar(const char* str);
1305 
1307 
1311 const char* urlencode(const char* str);
1312 
1314 
1318 const char* urldecode(const char* str);
1319 
1321 
1325 const char* getwritepath(const char* filename);
1326 
1328 
1332 const char* md5(const char* filename_or_string);
1333 
1335 
1339 const char* sha256(const char* filename_or_string);
1340 
1342 
1355 const char* openfile( );
1356 
1359 
1379 const char* getpushfile();
1380 
1382 
1386 bool voicestart(const char* savefilename);
1387 
1389 void voicestop();
1390 
1392 
1395 int clamp(int value, int min, int max);
1396 
1398 
1401 float clamp(float value, float min, float max);
1402 
1404 
1407 int lerp(int a, int b, float t);
1408 
1410 
1413 float lerp(float a, float b, float t);
1414 
1416 
1419 void setclipboard(const char* text);
1420 
1422 
1425 const char* getclipboard();
1426 
1428 void delay( int millisec );
1429 
1431 
1463 const char* strftime(const char* format);
1464 
1466 
1471 const char* strcmp(const char* str1, const char* str2);
1472 
1474 
1479 const char* getfilebasename(const char* filename, bool keep_extension = true );
1480 
1482 
1486 const char* getfileextension(const char* filename);
1487 
1489 
1493 const char* getfiledir(const char* filename);
1494 
1496 
1505 bool permission(const char* permission_name, bool require = true );
1506 
1508 
1512 bool ispsdfile(const char* filename);
1513 
1515 
1518 float getaccx();
1519 
1521 
1524 float getaccy();
1525 
1527 
1530 float getaccz();
1531 
1533 
1542 int getorient();
1543 
1545 
1548 float getdpid();
1549 
1551 
1554 float getdpix();
1555 
1557 
1560 float getdpiy();
1561 
1563 
1571 bool _or(test_expr, ...);
1572 
1574 
1582 bool _and(test_expr, ...);
1583 
1585 
1588 void maxsize(int left, int top, int right, int bottom);
1589 
1591 
1594 int getmaxsizestartx();
1595 
1597 
1600 int getmaxsizestarty();
1601 
1603 
1606 int getmaxsizewidth();
1607 
1609 
1612 int getmaxsizeheight();
1613 
1619 
1628 void screensize(int width, int height, bool upscale = false);
1629 
1632 
1637 void setscreentexturesize(int width, int height);
1638 
1640 
1644 
1646 
1650 
1653 
1656 void updatescreentoucharea();
1657 
1659 
1662 void setscreenupscale( bool active );
1663 
1665 
1668 bool isscreenupscale();
1669 
1671 
1678 int getsizeupscalewidth(int ow, int oh, int maxw, int maxh);
1679 
1681 
1688 int getsizeupscaleheight(int ow, int oh, int maxw, int maxh);
1689 
1691 
1694 int getscreensizewidth();
1695 
1697 
1700 int getscreensizeheight();
1701 
1703 
1708 const char* getthaipromptpay(const char* thaiid_or_mobile, const char* value);
1709 
1710 // query current psd filename with fullpath.
1714 const char* getpsdfilename();
1715 
1716 // query previous psd filename with fullpath.
1720 const char* getpsdfilenameprevious();
1721 
1723 
1728 int gettextlayerx(const char* layername, const char* string);
1729 
1731 
1736 int gettextlayery(const char* layername, const char* string);
1737 
1739 
1745 void gettextlayerfontx(const char* layername, const char* fontname, const char* string);
1746 
1748 
1754 void gettextlayerfonty(const char* layername, const char* fontname, const char* string);
bool isnumber(const char *var)
Determine if a variable is a number both int or float.
void clearqueuerender()
clear queue rendering both psd and font.
bool permission(const char *permission_name, bool require=true)
checking permission on mobile devices only.
void lfloat(const char *name, float value)
define low variable as float
void textlayer(const char *layername, const char *string, int r=255, int g=255, int b=255, int a=255)
display text follow layer position and attribute (build-in font is default)
void gettextlayerfonty(const char *layername, const char *fontname, const char *string)
get y position of text with custom font follow layer position and attribute.
void procedure(void *function1 >> void *function2 >> ... >> void *functionN)
procedure, a single line of commands that together perform a task
void textareafont(const char *layername, const char *areaname, const char *fontname, const char *string, int r=255, int g=255, int b=255, int a=255)
display text in area with custom font follow layer position and attribute.
bool sharefile(const char *mailto, const char *subject, const char *msg, const char *filename)
share text and file
void setscreentexturesize(int width, int height)
bool ispsdfile(const char *filename)
checking is psd file
bool isint(const char *var)
Determine if a variable is an int.
void maxsize(int left, int top, int right, int bottom)
maximum scene size
const char * getscreenshotname()
get a random name of screenshot
void updatescreentoucharea()
void setportrait()
set portrait mode call before screensize()
void add(const char *name, const char *value)
add value on variable
int getwinsizeheight()
get height on windows size Emulator only!!!
int getsizeupscaleheight(int ow, int oh, int maxw, int maxh)
get a new size upscale in height, calculate from original and max size.
int getcurrentfps()
get current fps
float getdpix()
get screen dpi x
float getdpiy()
get screen dpi y
void textlayerfont(const char *layername, const char *fontname, const char *string, int r=255, int g=255, int b=255, int a=255)
display text with custom font follow layer position and attribute.
void lint(const char *name, int value)
iftime(const char *name, test_expr, int delay) void *function
An if statement with time delay in millisecond. reset call ifreset()
void setdebug(int debug)
set debug mode
float getdeltatime()
get delta time
bool url(const char *url, bool webapp=false, bool use_webbrowser=true)
open url
int gettextlayery(const char *layername, const char *string)
get y position of text follow layer position and attribute (build-in font is default)
int getmaxsizestartx()
get start point on x axis in maximum scene
void ifreset(const char *name="")
reset ifcount() and iftime(), maybe call in deinit function.
float getaccx()
get accelerometer x
const char * base64decode(const char *str)
base64 decode
int getscreentexturesizewidth()
get width on texture screensize
void _sin(const char *name, const char *value)
_sin value on variable
void voicestop()
stop voice recording.
int getgamefps()
get game fps
r
rotation layer
Definition: builtin.h:39
bool sharescreenshot(const char *mailto, const char *subject, const char *msg)
share current screenshot
const char * savescreenshot(bool silent=false)
save current screenshot to jpg format
void exit()
exit application
ifelse(test_expr, void *function1, void *function2)
if else condition
void gstruct(const char *name, int value)
define global structure
float getdpid()
get screen dpi density
bool voicestart(const char *savefilename)
start voice recording and removing savefilename from audio system before recording.
void psdrenderall()
adding all layers in current psd file to queue rendering.
const char * random_guid(bool with_letter=false)
get random GUID number
int getmaxsizestarty()
get start point on y axis in maximum scene
const char * getuuid()
get device UUID
void clear()
free current psd file
void textalign(int align)
set text alignment, !!!call this before draw text function!!!
void sub(const char *name, const char *value)
subtract value on variable
void textarea(const char *layername, const char *areaname, const char *string, int r=255, int g=255, int b=255, int a=255)
display text in area follow layer position and attribute (build-in font is default)
const char * getpsdfilename()
void setgamefps(int fps)
set game fps, default: 60
int getwinsizewidth()
get width on windows size Emulator only!!!
void setscreenupscale(bool active)
set screen to upscale
void text(int x, int y, const char *string)
display text on screen by build-in font
bool openloading(const char *filename, bool only_psd=true)
show loading screen when load psd file
void setstring(const char *name, const char *value)
set string on variable, don't skip space
void delay(int millisec)
delay cpu circle in milli second
bool strstr(const char *string, const char *keyword)
search string, case sensitive
bool _and(test_expr,...)
AND operation with if statement consists of a boolean expression followed by one or more statements.
const char * random_string_custom(int len, const char *string_custom)
get random string with custom string
const char * openfile()
openfile dialog.
int getmaxsizewidth()
get width on maximum scene
bool _or(test_expr,...)
OR operation with if statement consists of a boolean expression followed by one or more statements.
bool psd(const char *filename, bool clear=true, bool cache=true, bool snd=true)
load a new psd file
void alog(const char *msg)
log message, a msg is showing on log window
const char * urldecode(const char *str)
url decode
int getsizeupscalewidth(int ow, int oh, int maxw, int maxh)
get a new size upscale in width, calculate from original and max size.
void mod(const char *name, const char *value)
mod value on variable
void setbgcolor(int r, int g, int b, int a)
set background color
const char * getfileextension(const char *filename)
get extension from from full path.
void winsize(int width, int height)
windows size, Emulator only!!!
int lerp(int a, int b, float t)
lerp value as int, Computes the linear interpolation between a and b, if the parameter t is inside [0...
const char * strftime(const char *format)
Get time format.
void string(const char *name, const char *value)
define local variable as string
const char * getversion()
get version of ARSA Framework in a string format.
bool isset(const char *var)
Determine if a variable is considered set, this means if a variable is declared and is different than...
bool isspace(const char *var)
Determine if a variable is a whitespace.
bool isstring(const char *var)
Determine if a variable is a string.
int touchmax()
get touch maximum id.
bool isscreenupscale()
is screen upscale
const char * strcmp(const char *str1, const char *str2)
The strcmp() compares two strings character by character. If the strings are equal,...
const char * getpushfile()
void setlandscape()
set landscape mode, call before screensize()
const char * getfilebasename(const char *filename, bool keep_extension=true)
get filename from full path.
void gstring(const char *name, const char *value)
define global variable as string
const char * sha256(const char *filename_or_string)
get sha256
const char * getwritepath(const char *filename)
get write path with filename and extension
int getorient()
get current screen orientation
const char * getfiledir(const char *filename)
get directory from from full path.
const char * camera()
int getscreensizeheight()
get height on screensize
int clamp(int value, int min, int max)
clamp value as int
void div(const char *name, const char *value)
divide value on variable
const char * getuserstring()
get user string
bool phonecall(const char *number)
phone call
void set(const char *name, const char *value)
set value on variable
const char * urlencode(const char *str)
url encode
float getaccy()
get accelerometer y
void _cos(const char *name, const char *value)
_cos value on variable
void addstring(const char *name, const char *value)
string cat, don't skip space
const char * md5(const char *filename_or_string)
get md5
void int(const char *name, int value)
define local variable as integer
void drawonce(bool clear=false, bool updateall=false)
drawing screen immediately!
bool touch(const char *state)
query touch state
void gint(const char *name, int value)
define global variable as integer
const char * random_string(int len)
get random string in lenght
const char * scanvar(const char *str)
scan string variable and math replacement
const char * getpsdfilenameprevious()
const char * version()
get version of thrid party libs in a string format.
const char * pickupgetlayername()
get layername from user pickup layer.
bool pickup(const char *state, const char *layername)
pickup on layername by state condition.
void setuserstring(const char *str)
set user string
void screensize(int width, int height, bool upscale=false)
int random()
get random number
const char * base64encode(const char *str)
base64 encode
void msgbox(const char *msg)
show message box
void arsalang(const char *src_name)
load external code, !!!use in Photoshop layer only!!!
int getmaxsizeheight()
get height on maximum scene
int getscreensizewidth()
get width on screensize
long gettime()
get virtual time
void proc(void *function1 >> void *function2 >> ... >> void *functionN)
short version of procedure().
void lstring(const char *name, const char *value)
define low variable as string
void touchclear()
touch clear buffer.
ifcount(const char *name, test_expr, int count) void *function
An if statement with count. reset call ifreset()
const char * getclipboard()
Get UTF-8 text from the clipboard.
int isdebug()
query this psd is on debug mode
void setclipboard(const char *text)
Put UTF-8 text into the clipboard.
const char * getredeemcode()
get current redeem code
float getzrot(float x1, float y1, float x2, float y2)
get z rotation between vector2d(x1,y1) and vector2d(x2,y2)
int gettextlayerx(const char *layername, const char *string)
get x position of text follow layer position and attribute (build-in font is default)
int getscreentexturesizeheight()
get height on texture screensize
const char * getgps()
get a gps location
long getrealtime()
get real time
void pickupclear()
clear pickup buffer.
bool touchid(int touch_id, const char *state)
query touch state by id
float getaccz()
get accelerometer z
bool isfloat(const char *var)
Determine if a variable is a float.
void float(const char *name, float value)
define local variable as float
void closeloading()
close loading screen when load psd file
const char * getpackage()
get application package
const char * strtok(const char *string, const char *token="")
Split string into tokens, DON'T USE ',' (comma) as token
const char * getplatform()
get current patform using.
const char * getthaipromptpay(const char *thaiid_or_mobile, const char *value)
get thai promptpay string
void gfloat(const char *name, float value)
define global variable as float
void gettextlayerfontx(const char *layername, const char *fontname, const char *string)
get x position of text with custom font follow layer position and attribute.
void mul(const char *name, const char *value)
multiply value on variable