ARSA Language
2.8
(Encryption, GPU and Web 3.0)
|
Go to the source code of this file.
Functions | |
void | hitlayer (const char *layername, void *function) |
query layername collide with other layer in psd file More... | |
void | hitlayer (const char *layername_a, const char *layername_b, void *function) |
query layername_a collide with layername_b More... | |
void | hitlayerfirst (const char *layername_a, const char *layername_b, void *function) |
query !!!FIRST TIME!!! layername_a collide with layername_b More... | |
void | hitlayerlast (const char *layername_a, const char *layername_b, void *function) |
query !!!LAST TIME!!! layername_a collide with layername_b More... | |
void | hitlayerall (const char *layername_a, const char *layername_b, void *function) |
query layername_a collide with all of layername_b More... | |
void | pos () |
set layer position by build-in layername and current touch position. More... | |
void | pos (const char *layername) |
set layer position by current touch position. More... | |
void | pos (const char *layername, int x, int y) |
set layer position by x and y axis More... | |
void | pos (const char *layername_dest, const char *layername_src) |
set layername_dest position by layername_src More... | |
void | posx (const char *layername, int x) |
set layer position by x axis More... | |
void | posy (const char *layername, int y) |
set layer position by y axis More... | |
void | move (const char *layername, int velx, int vely, bool deltatime=true) |
move layer by velocity More... | |
void | movex (const char *layername, int velx, bool deltatime=true) |
move layer by x velocity More... | |
void | movey (const char *layername, int vely, bool deltatime=true) |
move layer by y velocity More... | |
void | scale (const char *layername, float scalex, float scaley) |
scaling layer, value is 1: normal, great 1: larger, less 1: smaller More... | |
float | getdistance (const char *layername_a, const char *layername_b) |
get distance between layer a and b More... | |
float | getdistance (const char *layername) |
int | getposx (const char *layername) |
get x position from layer More... | |
int | getposy (const char *layername) |
get y position from layer More... | |
int | getposxf (const char *layername, int flags) |
get x position from layer with flags More... | |
int | getposyf (const char *layername, int flags) |
get y position from layer with flags More... | |
int | getorix (const char *layername) |
get original x position from layer More... | |
int | getoriy (const char *layername) |
get original y position from layer More... | |
int | getoutx (const char *layername) |
get out from screen in x position from layer More... | |
int | getouty (const char *layername) |
get out from screen in y position from layer More... | |
void | setorder (const char *layername, int order) |
set layer draw order, 0 is draw first, 999 is draw last More... | |
int | getorder (const char *layername) |
get layer draw order More... | |
void | setdrawflags (const char *layername, int flags) |
set draw pivot flags More... | |
int | getdrawflags (const char *layername) |
get draw pivot flags More... | |
void | setrotflags (const char *layername, int flags) |
set rotate pivot flags, default is c More... | |
int | getrotflags (const char *layername) |
get rotate pivot flags More... | |
void | setscaleflags (const char *layername, int flags) |
set scale pivot flags, default is c More... | |
int | getscaleflags (const char *layername) |
get scale pivot flags More... | |
void | setvisibleflags (const char *layername, int flags) |
set visible pivot flags, default is l|t More... | |
int | getvisibleflags (const char *layername) |
get visible pivot flags More... | |
int | getwidth (const char *layername) |
get layer width More... | |
int | getheight (const char *layername) |
get layer height More... | |
void | setoffset (int x, int y) |
set psd offset by x, y axis More... | |
void | moveoffset (int velx, int vely, bool deltatime=true) |
move psd offset by velocity More... | |
int | getoffsetx () |
get psd offset x axis More... | |
int | getoffsety () |
get psd offset y axis More... | |
void | settexture (const char *layername, const char *layer_name_or_image_file, bool resize=false) |
set new texture from psd layer or image (jpg, png, tga or etc.) More... | |
void | settexturelayer (const char *layername, const char *layer_name_or_image_file, int layer_num, bool resize=false) |
set a new texture on material by layer number from psd layer or image (jpg, png, tga or etc.) More... | |
int | addlayer (const char *layername_new, const char *image_file, bool force_add=false) |
add layer from image (jpg, png, tga or etc.) More... | |
void | clonelayer (const char *layername_new, const char *layername_original, bool force_add=false) |
clone layer, the new layer name must unique. More... | |
void | clonelayerbyid (const char *layername_new, int layername_original_id, bool force_add=false) |
clone layer by id, the new layer name must unique. More... | |
void | removelayer (const char *layername) |
remove layer in psd More... | |
void | getlayerall (const char *layername, void *function) |
loop all layer by name, program will loop all of layer and call function each one. More... | |
int | getlayercount () |
get all layer count in psd file More... | |
void | rot (const char *layername, int velx, int vely, int velz) |
advance rotation layer by axis More... | |
void | play () |
play animation on build-in layer More... | |
void | play (const char *layername) |
play animation on layername More... | |
void | pause () |
pause animation on build-in layer More... | |
void | pause (const char *layername) |
pause animation on layername More... | |
bool | isplaying () |
bool | isplaying (const char *layername) |
query layername is playing animation More... | |
void | setframe (const char *layername, int frame) |
set animation frame on layername More... | |
int | getframe (const char *layername) |
get current frame animation on layername More... | |
int | getframecount (const char *layername) |
get animation frame count on layername More... | |
void | setloopflags (const char *layername, int flags) |
set animation loop flags on layername More... | |
void | setvisiblepercent (const char *layername, int percentx, int percenty) |
set layername visible area by percent More... | |
int | getvisiblepercentx (const char *layername) |
get visible area x axis on layer More... | |
int | getvisiblepercenty (const char *layername) |
get visible area y axis on layer More... | |
int | getlayerid (const char *layername) |
get layer id from build-in layer More... | |
const char * | getlayername (int layer_id) |
get layername from build-in layer More... | |
const char * | getcurrentvalue () |
get current return value from the function. More... | |
void | setfps (const char *layername, int fps) |
set animation speed on layer More... | |
int | getfps (const char *layername) |
get animation speed on layer More... | |
void | visible (bool visible) |
Visible layer. More... | |
void | visible (bool visible, const char *layername) |
Visible layer by name. More... | |
void | visibleall (bool visible, const char *layername) |
Visible all layer by name, program will select all equal name. More... | |
void | isvisible (const char *layername, void *function) |
query and call function if layername is visible. More... | |
void | !isvisible (const char *layername, void *function) |
query and call function if layername is invisible. More... | |
void | isvisibleall (const char *layername, void *function) |
query and call function if all layername is visible. More... | |
void | !isvisibleall (const char *layername, void *function) |
query and call function if all layername is invisible. More... | |
void | setcolor (const char *layername, long color) |
set color on layer More... | |
void | setcolor (const char *layername, int r, int g, int b) |
set color on layer, value between 0-255 More... | |
void | setcolor (const char *layername, int r, int g, int b, int a) |
set color on layer, value between 0-255 More... | |
void | setalpha (const char *layername, int a) |
set alpha on layer, value between 0-255 More... | |
int | getcolor (const char *layername, const char *channel) |
get color by channel More... | |
void | maxsize (int left, int top, int right, int bottom) |
maximum scene size More... | |
int | getmaxsizestartx () |
get start point on x axis in maximum scene More... | |
int | getmaxsizestarty () |
get start point on y axis in maximum scene More... | |
int | getmaxsizewidth () |
get width on maximum scene More... | |
int | getmaxsizeheight () |
get height on maximum scene More... | |
void | screensize (int width, int height) |
int | getscreensizewidth () |
get width on screensize More... | |
int | getscreensizeheight () |
get height on screensize More... | |
bool | addgroup (const char *groupname) |
add group to a psd file More... | |
void | addelement (const char *groupname, const char *layername,...) |
add layer to a group More... | |
void | removeelement (const char *groupname, const char *layername,...) |
remove layer on a group More... | |
void | setgrouppos (const char *groupname, int x, int y) |
set group position by x and y axis More... | |
void | setgroupscale (const char *groupname, int scalex, int scalex) |
group scaling , value is 1: normal, great 1: larger, less 1: smaller More... | |
void | setgroupvisible (const char *groupname, bool visible=true) |
group visible More... | |
void | setgroupvisibleonlyone (const char *groupname, const char *layername, bool visible=true) |
group visible, invisible all except that specify one More... | |
void | setgroupplay (const char *groupname, bool play=true) |
play animation on group More... | |
void | setgroupplayonlyone (const char *groupname, const char *layername, bool play=true) |
play animation on group, stop all except that specify one More... | |
void | setgroupdrawflags (const char *groupname, int flags) |
set group draw pivot flags More... | |
void | setgrouprotflags (const char *groupname, int flags) |
set group rotate pivot flags More... | |
void | setgroupcolor (const char *groupname, int r, int g, int b, int a) |
set color on group, value between 0-255 More... | |
void | setgrouprot (const char *groupname, int velx, int vely, int velz) |
advance group rotation by axis More... | |
void | setgroupclamppos (const char *groupname, bool clamp=true) |
group clamp pos in maxsize area More... | |
void | setgroupdraworder (const char *groupname, int order=0) |
set group draw order, 0 is draw first, 999 is draw last More... | |
bool | isgroupplay (const char *groupname) |
query group is playing animation More... | |
int | getgroupcount () |
query all group count. More... | |
const char * | getgroupnamebyid (int group_num) |
query group name from group number (not group id). More... | |
int | getelementcount (const char *groupname) |
query all elements count in a group. More... | |
const char * | getelementnamebynum (const char *groupname, int element_num) |
query element name from group by number. More... | |
void | anim (const char *layername, const char *type, float start, float end, float vel, bool wait=true) |
animation layer More... | |
void | bat (float sec, const char *cmd) |
batch command follow by time (sec). More... | |
void | batvoid (float sec, const char *cmd) |
void | batplay (bool play) |
batch play/pause process. More... | |
void | batstop () |
batch stop process. More... | |
void | batclear () |
batch clear all command More... | |
void | batreset () |
batch reset and get back to first command More... | |
int | batgetcount () |
batch get count More... | |
const char * | savelayertoimage (const char *layername, const char *image_filename_ext) |
save psd layer to image and return fullpath of new saved file. More... | |
const char * | savelayertobase64 (const char *layername, const char *image_filename_ext) |
save psd layer to base64 encode and return data string. More... | |
const char * | savelayertomd5 (const char *layername, const char *image_filename_ext) |
save psd layer to md5 and return data string. More... | |
void | psdlog () |
debug and print current psd information and layer name in log window. More... | |
float | getrotx (const char *layername) |
get X layer rotation. More... | |
float | getroty (const char *layername) |
get Y layer rotation. More... | |
float | getrotz (const char *layername) |
get Z layer rotation. More... | |
float | getscalex (const char *layername) |
get X layer scale. More... | |
float | getscaley (const char *layername) |
get y layer scale. More... | |
void | settpos (const char *layername, float u, float v) |
set texture UV position More... | |
void | settposx (const char *layername, float u) |
set texture U position More... | |
void | settposy (const char *layername, float v) |
set texture V position More... | |
void | settrot (const char *layername, float x, float y) |
set texture XY rotation More... | |
void | settrotx (const char *layername, float x) |
set texture X rotation More... | |
void | settroty (const char *layername, float y) |
set texture Y rotation More... | |
void | settscale (const char *layername, float x, float y) |
set texture XY scale More... | |
void | settscalex (const char *layername, float x) |
set texture Y scale More... | |
void | settscaley (const char *layername, float y) |
set texture Y scale More... | |
void | settextureclamp (const char *layername, const char *value="repeat") |
set texture coord clamp mode outside [0.0, 1.0] More... | |
float | gettposx (const char *layername) |
get texture U position More... | |
float | gettposy (const char *layername) |
get texture V position More... | |
float | gettrotx (const char *layername) |
get texture X rotation More... | |
float | gettroty (const char *layername) |
get texture Y rotation More... | |
float | gettscalex (const char *layername) |
get texture X scale More... | |
float | gettscaley (const char *layername) |
get texture Y scale More... | |
const char * | gettextureclamp (const char *layername) |
get texture coord clamp mode More... | |
void | setuserstring (const char *layername, const char *key, const char *value) |
set psd user string More... | |
const char * | getuserstring (const char *layername, const char *key) |
get psd user string More... | |
void | setcliprect (const char *layername, const char *clip_src_layername) |
set layer clip rect by another layer. More... | |
void | setcliprect (const char *layername, int x1, int y1, int x2, int y2) |
set layer with clip rect. More... | |
void | setsize (const char *layername, int x1, int y1, int x2, int y2) |
set layer new size. More... | |
float | getsize (const char *layername, const char *axis="x1") |
get layer size with axis. More... | |
void | setgroupcliprect (const char *layername, int x1, int y1, int x2, int y2) |
set group of layers with clip rect. More... | |
void | setmaterialtype (const char *layername, int shader_id) |
set material type to layer More... | |
int | getmaterialtype (const char *layername) |
get material type from layer More... | |
bool | isexist (const char *layername) |
bool | !isexist (const char *layername) |
bool !isexist | ( | const char * | layername | ) |
layername | name of layer, can be null that choose build - in layername from the other function. |
void !isvisible | ( | const char * | layername, |
void * | function | ||
) |
query and call function if layername is invisible.
layername | name of layer, can be null that choose build-in layername from the other function. |
function | if layername invisible then call the function. |
void !isvisibleall | ( | const char * | layername, |
void * | function | ||
) |
query and call function if all layername is invisible.
layername | name of layer, can be null that choose build-in layername from the other function. |
function | if all layername invisible then call the function. |
void addelement | ( | const char * | groupname, |
const char * | layername, | ||
... | |||
) |
add layer to a group
groupname | name of group that you want operator |
layername | name of layer |
... | use comma as token and add next layer to group Example addelement(g_mu, mu_run, mu_jump, mu_idle) |
bool addgroup | ( | const char * | groupname | ) |
add group to a psd file
groupname | name of group that you want operator |
int addlayer | ( | const char * | layername_new, |
const char * | image_file, | ||
bool | force_add = false |
||
) |
add layer from image (jpg, png, tga or etc.)
layername_new | a new name of clone layer. |
image_file | name of image file. |
force_add | true is always add layer this, default is false |
void anim | ( | const char * | layername, |
const char * | type, | ||
float | start, | ||
float | end, | ||
float | vel, | ||
bool | wait = true |
||
) |
animation layer
automation animation on focus layer
layername | name of layer, can be null that choose build-in layername from the other function. |
type | animation type follows: fade delay audio video loop scale scalex scaley rot rotx roty rotz move movex movey visible visiblex visibley reset resetall clear clearall getcount offset offsetx offsety isend // is end all animate, if loop on then no effect. spline // anim( layername, spline, spline_num, vel, inverse, head, hed_degree_offset, wait, reset ) |
start | value definition depending on type of animation. |
end | value definition depending on type of animation. |
vel | speed of animation. |
wait | condition going to next animation after this animation finished, default: true Example: layer animation fx anim("boss", "roty", 0, 360, 300) // rotation in y axis anim("boss", "rotz", 0, 360, 300) // rotation in z axis Example: move screen offset may layer name is empty string anim("", "offset", 100, 500, 200, 750, 100, 300) // move position in x 100 to 500 pixel and y 200 to 750 axis with vel x 100 and y 350 sequencely. anim("", "offsetx", 200, 300, 100 ) // move from position 200 to 300 pixel in x axis with velocity 100 unit sequencely. anim("", "offsety", 400, 800, 200) // move from position 400 to 800 pixel in y axis with velocity 200 unit sequencely. Example: layer clear animation fx in individual and all layers |
void bat | ( | float | sec, |
const char * | cmd | ||
) |
batch command follow by time (sec).
sec | time for trigger command in second. |
cmd | arsa script command. |
void batclear | ( | ) |
batch clear all command
int batgetcount | ( | ) |
batch get count
void batplay | ( | bool | play | ) |
batch play/pause process.
play | true = play, false = pause. |
void batreset | ( | ) |
batch reset and get back to first command
void batstop | ( | ) |
batch stop process.
void batvoid | ( | float | sec, |
const char * | cmd | ||
) |
batch command follow by time (sec) with not changing any command until trigger call. purpose for change state in programmatically.
sec | time for trigger command in second. |
cmd | arsa script command. |
void clonelayer | ( | const char * | layername_new, |
const char * | layername_original, | ||
bool | force_add = false |
||
) |
clone layer, the new layer name must unique.
layername_new | a new name of clone layer. |
layername_original | name of layer, can be null that choose build-in layername from the other function. |
force_add | true is always add clone layer this, default is false. |
void clonelayerbyid | ( | const char * | layername_new, |
int | layername_original_id, | ||
bool | force_add = false |
||
) |
clone layer by id, the new layer name must unique.
layername_new | a new name of clone layer |
layername_original_id | id of layer, can be null that choose build-in layername from the other function. |
force_add | true is always add clone layer this, default is false |
int getcolor | ( | const char * | layername, |
const char * | channel | ||
) |
get color by channel
layername | name of layer, can be null that choose build-in layername from the other function. |
channel | the channel that want you get follows: red green blue alpha all |
const char* getcurrentvalue | ( | ) |
get current return value from the function.
float getdistance | ( | const char * | layername_a, |
const char * | layername_b | ||
) |
get distance between layer a and b
layername_a | name of layer, can be null that choose build-in layername from the other function. |
layername_b | name of layer, can be null that choose build-in layername from the other function. |
float getdistance | ( | const char * | layername | ) |
get distance between layername and build-in layer
not working! if invalid build-in layer.
layername | name of layer, can be null that choose build-in layername from the other function. |
int getdrawflags | ( | const char * | layername | ) |
get draw pivot flags
layername | name of layer, can be null that choose build-in layername from the other function. |
int getelementcount | ( | const char * | groupname | ) |
query all elements count in a group.
groupname | name of group that you want operator. |
const char* getelementnamebynum | ( | const char * | groupname, |
int | element_num | ||
) |
query element name from group by number.
groupname | name of group that you want operator. |
element_num | number of element (maybe from for loop) |
int getfps | ( | const char * | layername | ) |
get animation speed on layer
layername | name of layer, can be null that choose build-in layername from the other function. |
int getframe | ( | const char * | layername | ) |
get current frame animation on layername
layername | name of layer, can be null that choose build-in layername from the other function. |
int getframecount | ( | const char * | layername | ) |
get animation frame count on layername
layername | name of layer, can be null that choose build-in layername from the other function. |
int getgroupcount | ( | ) |
query all group count.
const char* getgroupnamebyid | ( | int | group_num | ) |
query group name from group number (not group id).
group_num | number of group (maybe from for loop) |
int getheight | ( | const char * | layername | ) |
get layer height
layername | name of layer, can be null that choose build-in layername from the other function. |
void getlayerall | ( | const char * | layername, |
void * | function | ||
) |
loop all layer by name, program will loop all of layer and call function each one.
layername | name of layer, can be "" is loop all layers or null that choose build-in layername from the other function. |
function | call the function, in function user can be save current layername follow: Example: loop layers by prefix Example: loop all layers |
int getlayercount | ( | ) |
get all layer count in psd file
int getlayerid | ( | const char * | layername | ) |
get layer id from build-in layer
layername | name of layer, can be null that choose build-in layername from the other function. |
const char* getlayername | ( | int | layer_id | ) |
get layername from build-in layer
layer_id | is specify layer from id, can be null that choose build-in layername from the other function. |
int getmaterialtype | ( | const char * | layername | ) |
get material type from layer
layername | name of layer, can be null that choose build - in layername from the other function. |
int getmaxsizeheight | ( | ) |
get height on maximum scene
int getmaxsizestartx | ( | ) |
get start point on x axis in maximum scene
int getmaxsizestarty | ( | ) |
get start point on y axis in maximum scene
int getmaxsizewidth | ( | ) |
get width on maximum scene
int getoffsetx | ( | ) |
get psd offset x axis
int getoffsety | ( | ) |
get psd offset y axis
int getorder | ( | const char * | layername | ) |
get layer draw order
layername | name of layer, can be null that choose build-in layername from the other function. |
int getorix | ( | const char * | layername | ) |
get original x position from layer
layername | name of layer, can be null that choose build-in layername from the other function. |
int getoriy | ( | const char * | layername | ) |
get original y position from layer
layername | name of layer, can be null that choose build-in layername from the other function. |
int getoutx | ( | const char * | layername | ) |
get out from screen in x position from layer
layername | name of layer, can be null that choose build-in layername from the other function. |
int getouty | ( | const char * | layername | ) |
get out from screen in y position from layer
layername | name of layer, can be null that choose build-in layername from the other function. |
int getposx | ( | const char * | layername | ) |
get x position from layer
layername | name of layer, can be null that choose build-in layername from the other function. |
get x position from layer with flags
layername | name of layer, can be null that choose build-in layername from the other function. |
flags | draw pivot flags, every flags can or bit. c = center l = left r = right t = top b = bottom h = horizontal flip v = vertical flip d = default is l|t |
int getposy | ( | const char * | layername | ) |
get y position from layer
layername | name of layer, can be null that choose build-in layername from the other function. |
get y position from layer with flags
layername | name of layer, can be null that choose build-in layername from the other function. |
flags | draw pivot flags, every flags can or bit. c = center l = left r = right t = top b = bottom h = horizontal flip v = vertical flip d = default is l|t |
int getrotflags | ( | const char * | layername | ) |
get rotate pivot flags
layername | name of layer, can be null that choose build-in layername from the other function. |
float getrotx | ( | const char * | layername | ) |
get X layer rotation.
float getroty | ( | const char * | layername | ) |
get Y layer rotation.
float getrotz | ( | const char * | layername | ) |
get Z layer rotation.
int getscaleflags | ( | const char * | layername | ) |
get scale pivot flags
layername | name of layer, can be null that choose build-in layername from the other function. |
float getscalex | ( | const char * | layername | ) |
get X layer scale.
float getscaley | ( | const char * | layername | ) |
get y layer scale.
int getscreensizeheight | ( | ) |
get height on screensize
int getscreensizewidth | ( | ) |
get width on screensize
float getsize | ( | const char * | layername, |
const char * | axis = "x1" |
||
) |
get layer size with axis.
layername | name of layer, can be null that choose build - in layername from the other function. |
axis | string is: x1 is left in pixel. y1 is top in pixel. x2 is right in pixel. y2 is bottom in pixel. |
const char* gettextureclamp | ( | const char * | layername | ) |
get texture coord clamp mode
layername | name of layer, can be null that choose build - in layername from the other function. |
float gettposx | ( | const char * | layername | ) |
get texture U position
float gettposy | ( | const char * | layername | ) |
get texture V position
float gettrotx | ( | const char * | layername | ) |
get texture X rotation
float gettroty | ( | const char * | layername | ) |
get texture Y rotation
float gettscalex | ( | const char * | layername | ) |
get texture X scale
float gettscaley | ( | const char * | layername | ) |
get texture Y scale
const char* getuserstring | ( | const char * | layername, |
const char * | key | ||
) |
get psd user string
layername | name of layer, can be null that choose build - in layername from the other function. |
key | userdata key. |
int getvisibleflags | ( | const char * | layername | ) |
get visible pivot flags
layername | name of layer, can be null that choose build-in layername from the other function. |
int getvisiblepercentx | ( | const char * | layername | ) |
get visible area x axis on layer
layername | name of layer, can be null that choose build-in layername from the other function. |
int getvisiblepercenty | ( | const char * | layername | ) |
get visible area y axis on layer
layername | name of layer, can be null that choose build-in layername from the other function. |
int getwidth | ( | const char * | layername | ) |
get layer width
layername | name of layer, can be null that choose build-in layername from the other function. |
void hitlayer | ( | const char * | layername, |
void * | function | ||
) |
query layername collide with other layer in psd file
If collided then call the function and send collided layername as build-in variable to other the function.
User can be use null instread layername.
layername | name of layer, can be null that choose build-in layername from the other function. |
function | call the function. |
void hitlayer | ( | const char * | layername_a, |
const char * | layername_b, | ||
void * | function | ||
) |
query layername_a collide with layername_b
If collided then call the function and send layername_b as build-in variable to other the function.
User can be use null instread layername.
layername_a | name of layer, must enter real layername |
layername_b | name of layer, must enter real layername |
function | call the function. |
void hitlayerall | ( | const char * | layername_a, |
const char * | layername_b, | ||
void * | function | ||
) |
query layername_a collide with all of layername_b
If collided then call the function and send each layername_b as build-in variable to other the function.
User can be use null instread layername.
layername_a | name of layer, can be null that choose build-in layername from the other function. |
layername_b | name of layer, can be null that choose build-in layername from the other function. |
function | call the function. |
void hitlayerfirst | ( | const char * | layername_a, |
const char * | layername_b, | ||
void * | function | ||
) |
query !!!FIRST TIME!!! layername_a collide with layername_b
If collided then call the function and send layername_b as build-in variable to other the function.
User can be use null instread layername.
layername_a | name of layer, must enter real layername |
layername_b | name of layer, must enter real layername |
function | call the function. |
void hitlayerlast | ( | const char * | layername_a, |
const char * | layername_b, | ||
void * | function | ||
) |
query !!!LAST TIME!!! layername_a collide with layername_b
If collided then call the function and send layername_b as build-in variable to other the function.
User can be use null instread layername.
layername_a | name of layer, must enter real layername |
layername_b | name of layer, must enter real layername |
function | call the function. |
bool isexist | ( | const char * | layername | ) |
layername | name of layer, can be null that choose build - in layername from the other function. |
bool isgroupplay | ( | const char * | groupname | ) |
query group is playing animation
groupname | name of group that you want operator |
bool isplaying | ( | ) |
bool isplaying | ( | const char * | layername | ) |
query layername is playing animation
layername | name of layer, can be null that choose build-in layername from the other function. |
void isvisible | ( | const char * | layername, |
void * | function | ||
) |
query and call function if layername is visible.
layername | name of layer, can be null that choose build-in layername from the other function. |
function | if layername visible then call the function. |
void isvisibleall | ( | const char * | layername, |
void * | function | ||
) |
query and call function if all layername is visible.
layername | name of layer, can be null that choose build-in layername from the other function. |
function | if all layername visible then call the function. |
maximum scene size
make maximum scene bounding box
move layer by velocity
layername | name of layer, can be null that choose build-in layername from the other function. |
velx | velocity in x axis, can be +/- |
vely | velocity in y axis, can be +/- |
deltatime | true is multiple delta time on velx and vely, false is not use that |
move psd offset by velocity
velx | velocity in x axis, can be + / - |
vely | velocity in y axis, can be + / - |
deltatime | true is multiple delta time on velx and vely, false is not use that |
void movex | ( | const char * | layername, |
int | velx, | ||
bool | deltatime = true |
||
) |
move layer by x velocity
layername | name of layer, can be null that choose build-in layername from the other function. |
velx | velocity in x axis, can be +/- |
deltatime | true is multiple delta time on velx, false is not use that |
void movey | ( | const char * | layername, |
int | vely, | ||
bool | deltatime = true |
||
) |
move layer by y velocity
layername | name of layer, can be null that choose build-in layername from the other function. |
vely | velocity in y axis, can be +/- |
deltatime | true is multiple delta time on vely, false is not use that |
void pause | ( | ) |
pause animation on build-in layer
void pause | ( | const char * | layername | ) |
pause animation on layername
layername | name of layer, can be null that choose build-in layername from the other function. |
void play | ( | ) |
play animation on build-in layer
void play | ( | const char * | layername | ) |
play animation on layername
layername | name of layer, can be null that choose build-in layername from the other function. |
void pos | ( | ) |
set layer position by build-in layername and current touch position.
void pos | ( | const char * | layername | ) |
set layer position by current touch position.
layername | name of layer, can be null that choose build-in layername from the other function. |
set layer position by x and y axis
layername | name of layer, can be null that choose build-in layername from the other function. |
x | horizontal position, positive is right, negative is left |
y | vertical position, positive is down, negative is up |
void pos | ( | const char * | layername_dest, |
const char * | layername_src | ||
) |
set layername_dest position by layername_src
layername | name of layer, must enter real layername |
layername_src | name of layer, can be null that choose build-in layername from the other function. |
void posx | ( | const char * | layername, |
int | x | ||
) |
set layer position by x axis
layername | name of layer, can be null that choose build-in layername from the other function. |
x | horizontal position, positive is right, negative is left |
void posy | ( | const char * | layername, |
int | y | ||
) |
set layer position by y axis
layername | name of layer, can be null that choose build-in layername from the other function. |
y | vertical position, positive is down, negative is up |
void psdlog | ( | ) |
debug and print current psd information and layer name in log window.
void removeelement | ( | const char * | groupname, |
const char * | layername, | ||
... | |||
) |
remove layer on a group
groupname | name of group that you want operator |
layername | name of layer |
... | use comma as token and add next layer to group <>Example removeelement(g_mu, mu_run, mu_jump, mu_idle) |
void removelayer | ( | const char * | layername | ) |
remove layer in psd
layername | name of layer, can be null that choose build-in layername from the other function. |
advance rotation layer by axis
layername | name of layer, can be null that choose build-in layername from the other function. |
velx | velocity in x axis, can be +/- |
vely | velocity in y axis, can be +/- |
velz | velocity in z axis, can be +/- |
const char* savelayertobase64 | ( | const char * | layername, |
const char * | image_filename_ext | ||
) |
save psd layer to base64 encode and return data string.
layername | name of layer, can be null that choose build - in layername from the other function. |
image_filename_ext | filename with extension of image that you want to save, may be *.jpg, *.png or *.bmp |
const char* savelayertoimage | ( | const char * | layername, |
const char * | image_filename_ext | ||
) |
save psd layer to image and return fullpath of new saved file.
layername | name of layer, can be null that choose build - in layername from the other function. |
image_filename_ext | filename with extension of image that you want to save, may be *.jpg, *.png or *.bmp |
const char* savelayertomd5 | ( | const char * | layername, |
const char * | image_filename_ext | ||
) |
save psd layer to md5 and return data string.
layername | name of layer, can be null that choose build - in layername from the other function. |
image_filename_ext | filename with extension of image that you want to save, may be *.jpg, *.png or *.bmp |
scaling layer, value is 1: normal, great 1: larger, less 1: smaller
NOT equal 0
layername | name of layer, can be null that choose build-in layername from the other function. |
scalex | scale in x axis, value can be float |
scaley | scale in y axis, value can be float |
screen size, default in landscape: 960,640 portrait: 640,960
set universal resolution, screen will run same size in any devices
Specify aspect ratio fist and resolution after. calculate apect raio from:
https://calculateaspectratio.com/
https://andrew.hedges.name/experiments/aspect_ratio/
width | screen size on x axis |
height | screen size on y axis |
void setalpha | ( | const char * | layername, |
int | a | ||
) |
set alpha on layer, value between 0-255
layername | name of layer, can be null that choose build-in layername from the other function. |
a | alpha channel value |
void setcliprect | ( | const char * | layername, |
const char * | clip_src_layername | ||
) |
set layer clip rect by another layer.
layername | name of layer, can be null that choose build - in layername from the other function. |
clip_src_layer | name of layer is use boundingbox is cliprect size and automatic invisible this layer. |
set layer with clip rect.
layername | name of layer, can be null that choose build - in layername from the other function. |
x1 | is left in pixel |
y1 | is top in pixel |
x2 | is right in pixel |
y2 | is bottom in pixel |
void setcolor | ( | const char * | layername, |
long | color | ||
) |
set color on layer
color | value of color |
set color on layer, value between 0-255
layername | name of layer, can be null that choose build-in layername from the other function. |
r | red channel value |
g | green channel value |
b | blue channel value |
set color on layer, value between 0-255
layername | name of layer, can be null that choose build-in layername from the other function. |
r | red channel value |
g | green channel value |
b | blue channel value |
a | alpha channel value |
void setdrawflags | ( | const char * | layername, |
int | flags | ||
) |
set draw pivot flags
layername | name of layer, can be null that choose build-in layername from the other function. |
flags | draw pivot flags, every flags can or bit. c = center l = left r = right t = top b = bottom h = horizontal flip v = vertical flip d = default is l|t |
void setfps | ( | const char * | layername, |
int | fps | ||
) |
set animation speed on layer
layername | name of layer, can be null that choose build-in layername from the other function. |
fps | frame per second, default is 30 |
void setframe | ( | const char * | layername, |
int | frame | ||
) |
set animation frame on layername
layername | name of layer, can be null that choose build-in layername from the other function. |
frame | animation going to frame |
void setgroupclamppos | ( | const char * | groupname, |
bool | clamp = true |
||
) |
group clamp pos in maxsize area
groupname | name of group that you want operator |
set group of layers with clip rect.
groupname | name of group that you want operator |
x1 | is left in pixel |
y1 | is top in pixel |
x2 | is right in pixel |
y2 | is bottom in pixel |
set color on group, value between 0-255
groupname | name of group that you want operator |
r | red channel value |
g | green channel value |
b | blue channel value |
a | alpha channel value |
void setgroupdrawflags | ( | const char * | groupname, |
int | flags | ||
) |
set group draw pivot flags
groupname | name of group that you want operator |
flags | draw pivot flags, every flags can or bit. c = center l = left r = right t = top b = bottom h = horizontal flip v = vertical flip d = default is l|t |
void setgroupdraworder | ( | const char * | groupname, |
int | order = 0 |
||
) |
set group draw order, 0 is draw first, 999 is draw last
groupname | name of group that you want operator |
order | draw order, 0-999 |
void setgroupplay | ( | const char * | groupname, |
bool | play = true |
||
) |
play animation on group
groupname | name of group that you want operator |
play | true: playing, false: stop |
void setgroupplayonlyone | ( | const char * | groupname, |
const char * | layername, | ||
bool | play = true |
||
) |
play animation on group, stop all except that specify one
groupname | name of group that you want operator |
layername | name of layer, must enter real layername |
play | true: playing, false: stop |
set group position by x and y axis
groupname | name of group that you want operator |
x | horizontal position, positive is right, negative is left |
y | vertical position, positive is down, negative is up |
advance group rotation by axis
groupname | name of group that you want operator |
velx | velocity in x axis, can be +/- |
vely | velocity in y axis, can be +/- |
velz | velocity in z axis, can be +/- |
void setgrouprotflags | ( | const char * | groupname, |
int | flags | ||
) |
set group rotate pivot flags
groupname | name of group that you want operator |
flags | rotate pivot flags, every flags can or bit. c = center l = left r = right t = top b = bottom h = horizontal flip v = vertical flip d = default is l|t |
group scaling , value is 1: normal, great 1: larger, less 1: smaller
NOT equal 0
groupname | name of group that you want operator |
scalex | scale in x axis, value can be float |
scaley | scale in y axis, value can be float |
void setgroupvisible | ( | const char * | groupname, |
bool | visible = true |
||
) |
group visible
groupname | name of group that you want operator |
visible | true, false. the layer shall be visible. |
void setgroupvisibleonlyone | ( | const char * | groupname, |
const char * | layername, | ||
bool | visible = true |
||
) |
group visible, invisible all except that specify one
groupname | name of group that you want operator |
layername | name of layer, must enter real layername |
visible | true, false. the layer shall be visible. |
void setloopflags | ( | const char * | layername, |
int | flags | ||
) |
set animation loop flags on layername
layername | name of layer, can be null that choose build-in layername from the other function. |
flags | loop flags canbe orbit: true - loop forever once - play one time pp - ping pong |
void setmaterialtype | ( | const char * | layername, |
int | shader_id | ||
) |
set material type to layer
layername | name of layer, can be null that choose build - in layername from the other function. |
shader_id | id from gpu.addshader() |
set psd offset by x, y axis
x | horizontal position, positive is right, negative is left |
y | vertical position, positive is down, negative is up |
void setorder | ( | const char * | layername, |
int | order | ||
) |
set layer draw order, 0 is draw first, 999 is draw last
layername | name of layer, can be null that choose build-in layername from the other function. |
order | draw order, 0-999 |
void setrotflags | ( | const char * | layername, |
int | flags | ||
) |
set rotate pivot flags, default is c
layername | name of layer, can be null that choose build-in layername from the other function. |
flags | rotate pivot flags, every flags can or bit. c = center l = left r = right t = top b = bottom h = horizontal flip v = vertical flip d = default is l|t |
void setscaleflags | ( | const char * | layername, |
int | flags | ||
) |
set scale pivot flags, default is c
layername | name of layer, can be null that choose build-in layername from the other function. |
flags | scale pivot flags, every flags can or bit. c = center l = left r = right t = top b = bottom h = horizontal flip v = vertical flip d = default is l|t |
set layer new size.
layername | name of layer, can be null that choose build - in layername from the other function. |
x1 | is left in pixel |
y1 | is top in pixel |
x2 | is right in pixel |
y2 | is bottom in pixel |
void settexture | ( | const char * | layername, |
const char * | layer_name_or_image_file, | ||
bool | resize = false |
||
) |
set new texture from psd layer or image (jpg, png, tga or etc.)
layername | name of layer or null that choose build-in layername from the other function. |
layer_name_or_image_file | layer name or name of image file or null is clear texture on first slot. |
resize | !!!effective for image filename ONLY!!! resize texture fit to layer before set. |
void settextureclamp | ( | const char * | layername, |
const char * | value = "repeat" |
||
) |
set texture coord clamp mode outside [0.0, 1.0]
layername | name of layer, can be null that choose build - in layername from the other function. |
value | clamp value: repeat clamp clamp_to_edge (iPhone with NPOT texture use this flag) clamp_to_border mirror mirror_clamp mirror_clamp_to_edge mirror_clamp_to_border |
void settexturelayer | ( | const char * | layername, |
const char * | layer_name_or_image_file, | ||
int | layer_num, | ||
bool | resize = false |
||
) |
set a new texture on material by layer number from psd layer or image (jpg, png, tga or etc.)
layername | name of layer or null that choose build-in layername from the other function. |
layer_name_or_image_file | layer name or name of image file or null is clear texture on a slot. |
layer_num | number layer of texture to be set. Must be a value smaller than MATERIAL_MAX_TEXTURES (0-7) |
resize | !!!effective for image filename ONLY!!! resize texture fit to layer before set. |
void settposx | ( | const char * | layername, |
float | u | ||
) |
set texture U position
void settposy | ( | const char * | layername, |
float | v | ||
) |
set texture V position
void settrotx | ( | const char * | layername, |
float | x | ||
) |
set texture X rotation
void settroty | ( | const char * | layername, |
float | y | ||
) |
set texture Y rotation
void settscalex | ( | const char * | layername, |
float | x | ||
) |
set texture Y scale
void settscaley | ( | const char * | layername, |
float | y | ||
) |
set texture Y scale
void setuserstring | ( | const char * | layername, |
const char * | key, | ||
const char * | value | ||
) |
set psd user string
layername | name of layer, can be null that choose build - in layername from the other function. |
key | userdata key, cannot be empty and if key not exist is insert, otherwise update. |
value | userdata value. |
void setvisibleflags | ( | const char * | layername, |
int | flags | ||
) |
set visible pivot flags, default is l|t
layername | name of layer, can be null that choose build-in layername from the other function. |
flags | visible pivot flags, every flags can or bit. c = center l = left r = right t = top b = bottom h = horizontal flip v = vertical flip d = default is l|t |
set layername visible area by percent
value between 0 - 100
0: invisible, 100: full visible
value canbe positive or negative
positive visible area starting from left to right
negative visible area starting from right to left
layername | name of layer, can be null that choose build-in layername from the other function. |
percentx | visible area on horizontal |
percenty | visible area on vertical |
void visible | ( | bool | visible | ) |
Visible layer.
visible | true, false. the layer shall be visible. |
void visible | ( | bool | visible, |
const char * | layername | ||
) |
Visible layer by name.
visible | true, false. the layer shall be visible. |
layername | name of layer, can be null that choose build-in layername from the other function. |
void visibleall | ( | bool | visible, |
const char * | layername | ||
) |
Visible all layer by name, program will select all equal name.
visible | true, false. the layer shall be visible. |
layername | name of layer, can be null that build-in layername from the other function choose. |