Div Games Online
logo Div Games Online

Documentation: Functions list of Div GO : Div Games Online v1.24.0

original functions new functions
filter functions:
[ALL FUNCTIONS] [math] [graphics primitives] [string] [print text] [interaction processes] [scroll]
[mode7] [scene3D] [graphic effects] [sound] [video] [geometric] [pathfinding] [color] [region]
[general interaction program] [date/time] [saved data] [string conversion] [resource load]
[music module] [array functions]
search functions:  

98 original functions (Div / Div 2):

abs(value);see example
acos(value);see example
advance(distance);see example
asin(value);see example
atan(value);see example
atan2(value, value);
calculate(calculating text);see example
[returns a numeric value of a text and the result of the values ​​written as a calculator, ex: "((120+30)*2)/5"]
change_sound(channel id, volume, frequency);
char(value or text);see example
[returns a unicode value if you put a character in quotes or returns a character if you put your unicode value]
clear_screen();see example
collision(process id or TYPE process name, precision);see example
- png, svg and gif with alpha channel
- precision (optional): 0 (inaccurate) to 10 (very accurate), default value 9
cos(value);
define_region(region number, x, y, width, height);see example
delete_draw(draw id);see example
- all_drawing: with this constant value, delete of display all primitives graphical
delete_text(text id);
- all_text: using this constant value, delete all text of screen
draw(shape, color, opacity, region, x0, y0, x1, y1);see example
- shape:
1 = line
2 = rectangle
3 = rectangle filled
4 = ellipse
5 = ellipse filled
- color: hexadecimal or rgb(red, green, blue);
- opacity: 0 to 15 for opacity
- region: region number defined with define_region();
- x0: position x
- y0: position y
- x1: position final x, to the width
- y1: position final y, to the height
exit(text, type of output);see example
fade(red, green, blue, speed);see example
- red: 0% (black) to 200% (white), 100% hue not shown
- green: 0% (black) to 200% (white), 100% hue not shown
- blue: 0% (black) to 200% (white), 100% hue not shown
- speed: with a number higher or equal to 64, the cast will be instant
fade_off(speed);see example
- speed: with a number higher or equal to 64, the cast will be instant
fade_on(speed);see example
- speed: with a number higher or equal to 64, the cast will be instant
fget_angle(x0, y0, x1, y1);
[returns the angle between point 0 (x0, y0) and point 1 (x1, y1)]
fget_dist(x0, y0, x1, y1);
[returns the distance between point 0 (x0, y0) and point 1 (x1, y1)]
frame(percentage);see example
- percentage: 100 = process are updated every frame; 200 = 2 frames each change; 300 = every 3, ...
get_angle(process id);see example
get_dist(process id);see example
get_distx(angle, distance);see example
- angle: from 0 to 360000
get_disty(angle, distance);see example
- angle: from 0 to 360000
get_id(TYPE process name);see example
get_pixel(x, y, color);see example
- color (optional): for get one value of rgb: "r" or 0 for red; "g" or 1 for green; "b" or 2 for blue
get_point(file, graph, number, OFFSET x, OFFSET y);see example
get_real_point(number, OFFSET x, OFFSET y);see example
get_song_line();see example
[returns the line number of the musical module]
get_song_pos();see example
[returns the current position of the musical module which is being played]
graphic_info(file, graph, information);see example
is_playing_song();see example
[returns 0 if the sound module is stopped and 1 if it is playing]
is_playing_sound(channel id);
[returns 0 if the sound channel is stopped and 1 if it is playing]
itoa(variable);
- variable: converts a numeric value to a string
key(keyboard code);see example
let_me_alone();see example
load_fpg(file path);
load_song(filename, cyclic);see example
- cyclic: 0 to beep 1 time; 1 to ring being repeated indefinitely
lower(char or text);see example
[returns lowercase text]
map_block_copy(file, graph1, x1, y1, graph2, x2, y2, width, height);see example
map_get_pixel(file, graph, x, y, color);see example
- color (optional): for get one value of rgb: "r" or 0 for red; "g" or 1 for green; "b" or 2 for blue
map_put(file, graph1, graph2, x, y);see example
map_put_pixel(file, graph, x, y, color);see example
map_xput(file, graph1, graph2, x, y, angle, size, flags);see example
move_draw(identifier, color, opacity, x, y, width, height);
move_scroll(number);see example
- number: scroll number 0 to 9
move_text(identifier, x, y);
near_angle(angle, final angle, increment);see example
new_map(width, height, x_center, y_center, color);see example
- x_center: position x
- y_center: position y
- color: hexadecimal or rgb(red, green, blue);
out_region(identifier, region);see example
- identifier: process id
- region: region number defined with define_region();
path_find(mode, file, graph, scale, x, y, OFFSET struct, sizeof(struct));
path_free(file, graph, scale, x, y);
path_line(file, graph, scale, x, y);
pow(value, value);
put(file, graph, x, y);see example
- file:
- graph: fpg code graphic drawing
- x: position x
- y: position y
put_pixel(x, y, color);see example
- x: position x
- y: position y
- color: hexadecimal or rgb(red, green, blue);
put_screen(file, graph);see example
- file:
- graph: fpg code graphic drawing on the screen background
qsort(struct name, field name, mode);see example
- Mode:
0 for ascending order (from lowest to highest)
1 for descending order (from highest to lowest)
2 for random disorder.
rand(minimum value, maximum value);see example
screen_copy(region file, graph, x, y, width, height);see example
set_fps(number of frames per second, number of skips allowed);
set_mode(new video mode);
- change video mode, option 1 (support Div/ Div2):
m320x240
m640x480
m800x600
(view the list of variables)
- option 2 (support Gemix/ BennuGD):
set_mode(width, height);
- option 3 (DivGO):
set_mode(width, height, rescale);
- rescale: x1 o 1 (normal); x2 o 2 (double); x3 o 3 (triple), etc...
set_mode(mwidthxheight, rescale);
- rescale: 1 (normal); 2 (double); 3 (triple), etc...
set_song_pos(position of the module);
[fixes the position of the music module playback (the "pattern" number)]
set_title(page title);
set_volume(volume);
- volume: 0-100 to increase or decrease the overall volume of the game
signal(process id or TYPE process name, signal);see example
- signal: s_kill, s_sleep, s_freeze, s_wakeup, s_kill_tree, s_sleep_tree, s_freeze_tree, s_wakeup_tree
sin(value);
sizeof(variable);see example
[returns the number of elements contained in the variable]
song(identifier of the module);see example
sound(sound id, volume, frequency);
- sound id: returned by the sound file loaded with load_sound ()
- volume: 0 for minimum volume, maximum volume to 256
- frequency: 256 is the standard rate
sqrt(value);
start_mode7(number, file, graph1, graph2, region, horizon);
- number: mode7 number 0 to 9
- file:
- graph1:
- graph2:
- region: region number defined with define_region();
- horizon: pixels in height where you want to begin the horizon
start_scroll(number, file, graph1, graph2, region, scroll lock);see example
- number: scroll number 0 to 9
- file:
- graph1:
- graph2:
- region: region number defined with define_region();
- scroll lock:
stop_mode7(number);
- number: mode7 number 0 to 9
stop_scroll(number);
- number: scroll number 0 to 9
stop_song();see example
stop_sound(channel id);
strcat(text destination, source text);
[returns concatenated text]
strchr(text, character);
[seek one or more characters within text, it returns the position of the first character found]
strcmp(text 1, text 2);
[compares two texts and returns 0 if both are identical]
strcpy(text destination, source text);
[source text copy on destination text]
strdel(text, start position, final position);
[returns the text starting at the start position and cutting by the final position, eliminated what it may have before and after in the original text]
strlen(text);
[returns the value of the length of characters that there is in the text, counting also blank spaces]
strset(text, character);
[returns the first position of the text sought]
strstr(string, search string);
[returns the first position of the search string]
tan(value);
unload_fpg(id);
unload_song(identifier of the module);see example
unload_sound(sound id);
upper(char or text);see example
[returns uppercase texts]
write(font, x, y, centering code, text);see example
- font: id returned by load_font()
- x: position x
- y: position y
- centering code: 0 to 8
- text: "write text"
write_in_map(font, text, centering code);see example
- font: id returned by load_font()
- text: "write text"
- centering code: 0 to 8
write_int(font, x, y, centering code, OFFSET variable);see example
- font: id returned by load_font()
- x: position x
- y: position y
- centering code: 0 to 8
- OFFSET variable: put varible defined
xadvance(angle, distance);see example
- angle: from 0 to 360000
xput(file, graph, x, y, angle, size, flags, region);see example
- file
- graph: fpg code graphic drawing
- x: position x
- y: position y
- angle: angle of the graphic
- size: size of the graphic
- flags: 0 to 7
0 normal
1 mirrored horizontally
2 mirrored vertically
3 horizontal and vertical mirrored (180°)
4 transparent graphic
5 transparent and mirrored horizontally
6 transparent and mirrored vertically
7 transparent mirrored horizontally and vertically
- region: region number defined with define_region();