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:  

254 functions (Div / Div 2 / Div GO):

abs(value);see example
acos(value);see example
advance(distance);see example
asin(value);see example
atan(value);see example
atan2(value, value);
atob(variable);
base64_decode(variable);see example
base64_encode(variable);see example
blur_in_map(file, graph, value);see example
- value: from 0 to 30 in order to variation of blur effect, 0 being focused and 30 the greatest blur
btoa(variable);see example
- variable: converts a numeric value in a binary string
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"]
ceil(value);see example
change_fpg_color(file, color source, color change, tonality);see example
change_sound(channel id, volume, frequency);
change_vectors(3d object id, quantity);see example
change_video(media 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_map(file, graph, x, y, width, height);
clear_map_put(file, graph1, graph2, x, y);see example
clear_map_xput(file, graph1, graph2, x, y, angle, size, flags);see example
clear_screen();see example
clear_shadows(number);see example
clear_texture(3d object id);
close_socket(id socket);
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
collision_box(process id or TYPE process name);see example
collision_circle(process id or TYPE process name);see example
collision_objects3d(id1, id2);see example
color_in_map(file, graph, color);see example
- color: hexadecimal or rgb(red, green, blue);
color_object3d(3d object id, color);see example
- color: hexadecimal or rgb(red, green, blue);
constraint(id1, stop id1, id2, stop id2, distance, elasticity);see example
- id1: id of a process
- stop id1: true or false to set the id1 process regarding the process id2
- id2: id of the second process
- stop id2: true or false to set the id2 process regarding the process id1
- distance: distance between the two processes from its center point
- elasticity: the higher the number will be more elastic effect, 0 = not elastic
continue_sound(channel id, time);
- time: from where will continue playing the sound
continue_video(media id, time);
- time: from where will continue playing the video
cos(value);
date(date variable);see example
- date variable:
d_day // returns the numeric value of the day
d_week // returns the numeric value of the week
d_month // returns the numeric value of the month
d_year // returns the numeric value of the year
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_input(input id);see example
delete_light3d(light id);
delete_link(link id);see example
delete_local_storage(OFFSET variable);
delete_object3d(3d object id);
delete_region(region number);see example
delete_session(OFFSET variable);
delete_text(text id);
- all_text: using this constant value, delete all text of screen
delete_xdraw(xdraw identifier);
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
draw_stamp(draw id);see example
- all_drawing: with this constant value, delete of display all primitives graphical
enable_geolocation();
enable_notifications();
exists(process id or TYPE process name);see example
[returns TRUE or FALSE, if exists the process]
exit(text, type of output);see example
exp(value);
explode(variable, delimiter character);see example
[returns an array with the values delimited by the character string, making each element of the array has a fragment of the string]
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_in(speed, file, graph, x, y, angle);see example
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
fade_out(speed, file, graph, x, y, angle);see example
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)]
find_local_storage(OFFSET variable);see example
[returns TRUE or FALSE, if the variable saved exists]
find_session(OFFSET variable);
[returns TRUE or FALSE, if the session variable exists]
floor(value);see example
frame(percentage);see example
- percentage: 100 = process are updated every frame; 200 = 2 frames each change; 300 = every 3, ...
fullscreen_scale(rescale);see example
get_angle(process id);see example
get_browser(browser / os variable);see example
- browser / os variable:
b_width // width of the browser
b_height // height of the browser
b_os_width // width screen of the o.s.
b_os_height // height screen of the o.s.
b_name // name of the browser
b_os_name // name of the o.s.
b_language // browser language
b_joy_connect // true or false if joy or pad is connected
b_pad_connect // true or false if joy or pad is connected
b_name_joy // name of joy / pad
b_name_pad // name of joy / pad
get_channel(channel number);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_image_tiles(image, width, height);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_socket(id socket);
get_song_channels();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]
get_sound_length(channel id);
[returns the total length in seconds of the sound]
get_sound_playtime(channel id);
[returns the time in seconds what has been reproduced]
get_video_length(media id);
[returns the total length in seconds of the video]
get_video_playtime(media id);
[returns the time in seconds what has been reproduced]
gradient_draw(id, color, x0, y0, x1, y1);see example
- color: hexadecimal or rgb(red, green, blue);
gradient_text(id, color, x0, y0, x1, y1);see example
- color: hexadecimal or rgb(red, green, blue);
graphic_builder(variable);see example
graphic_explorer(file, graph);see example
graphic_info(file, graph, information);see example
hsl(hue, saturation, lighting);
- hue: this value is in degrees from 0 to 360, where 0 and 360 the red color
- saturation: this percentage value is from 0 to 100
- lighting: this percentage value is from 0 to 100
hsla(hue, saturation, lighting, alpha);
- hue: this value is in degrees from 0 to 360, where 0 and 360 the red color
- saturation: this percentage value is from 0 to 100
- lighting: this percentage value is from 0 to 100
- alpha: this value is decimal from 0 to 255, with 0 being transparent
htoa(variable);see example
- variable: converts a numeric value to a hexadecimal string
implode(array, unifying character);
- returns a string with the array elements together by the unifying character
input(font, border, border color, x, y, width, height, max character, alignment, OFFSET variable);see example
is_defined_region(region number);see example
[returns TRUE or FALSE, if region exists or not]
is_finite(variable);
is_fullscreen();see example
is_int(variable);
is_nan(variable);
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]
is_playing_video(media id);
[returns 0 if the video is stopped and 1 if it is playing]
itoa(variable);
- variable: converts a numeric value to a string
key(keyboard code);see example
key_in(keyboard code);see example
key_out(keyboard code);see example
let_me_alone();see example
light3d(intensity, color, distance, x, y, z);see example
- intensity: minimum value 0 (light off) and maximum 200 (strong light); 100 is the default - color: hexadecimal or rgb(red, green, blue); - distance: how far will the light in the 3d scene
link(border, color, x, y, width, height, url, target);see example
load_external_data(filename);
load_font(filename);
load_fpg(file path);
load_image(filename);
- accepts images format: png, jpg, svg, png, bmp
load_local_storage(OFFSET variable);see example
load_object3d(filename, wireframe, color, x, y, z);
- accepts 3D objects format: obj, dae, wrl
- wireframe: 0 to show solid object; 1 to show the wireframe of the object
- color: hexadecimal o rgb(red, green, blue);
load_session(OFFSET variable);
load_song(filename, cyclic);see example
- cyclic: 0 to beep 1 time; 1 to ring being repeated indefinitely
load_sound(filename, cyclic);
- cyclic: 0 to beep 1 time; 1 to ring being repeated indefinitely
load_video(filename, cyclic);
- cyclic: 0 to beep 1 time; 1 for reproducing being repeated indefinitely
log(value);
lower(char or text);see example
[returns lowercase text]
ltrim(text);see example
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
modify_object3d(3d object id, alpha, width, height, long);
move_draw(identifier, color, opacity, x, y, width, height);
move_light3d(light id, intensity, x, y, z);
- intensity: minimum value 0 (light off) and maximum 200 (strong light); 100 is the default
move_link(link id, border, color, x, y);see example
move_link(input id, border, color, x, y);
move_object3d(3d object id, x, y, z, angle x, angle y, angle z);
move_scroll(number);see example
- number: scroll number 0 to 9
move_text(identifier, x, y);
move_video(media id, flags, angle, alpha, x, y, width, height, region);
move_xdraw(xdraw id, x, y, size, angle, alpha);
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);
notification(file, graph, title, description);see example
object_in_scene3d(id, number);
object3d(type, wireframe, color, alpha, line drawn, x, y, z);see example
- type:
0 = plane
1 = cube
2 = sphere
3 = torus
4 = cylinder
- wireframe: 0 to show solid object; 1 to show the wireframe of the object
- color: hexadecimal o rgb(red, green, blue);
- alpha: object opacity
- region: region number defined with define_region();
open_socket(url ws o wss(secure));
otoa(variable);see example
- variable: converts a numeric value into a string octal
out_region(identifier, region);see example
- identifier: process id
- region: region number defined with define_region();
out_region_dist(identifier, region);see example
- identifier: process id
- region: region number defined with define_region();
paint_in_map(file, graph, color);
- color: hexadecimal or rgb(red, green, blue);
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);
pause_sound(channel id);
[returns the time where it has been paused in milliseconds]
pause_video(media id);
[returns the time where it has been paused in milliseconds]
pixelated_in_map(file, graph, variation);
- variation of 0 to 100 to change the size of the pixel, with 0 being the normal size and the largest size 100
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
region_blur(region, value);see example
- region: region number defined with define_region();
- value: from 0 to 30 in order to variation of blur effect, 0 being focused and 30 the greatest blur
region_chroma(region number, color, hue);see example
region_color(region, color);
- region: region number defined with define_region();
- color: hexadecimal or rgb(red, green, blue);
region_copy(destination region, origin region);see example
region_mask(region, file, graph, x, y, size, alpha);
- region: region number defined with define_region();
region_pixelated(region, variation);see example
- region: region number defined with define_region();
- variation of 0 to 100 to change the size of the pixel, with 0 being the normal size and the largest size 100
region_wave(region, orientation, amplitude, variation);
- region: region number defined with define_region();
- orientation: 0 horizontal, 1 vertical
- amplitude: separation of waves: 0 without separation, 1 for 1px of separate, 2 for 2px... 10px... in forward
- variation of -100 to 100 to change the size of the pixel, with 0 being the normal size and the largest size 100
region_zoom(region, x, y, variation);
- region: region number defined with define_region();
- variation of 0 to 100 to change the size of the pixel, with 0 being the normal size and the largest size 100
rgb(red, green, blue);see example
rgba(red, green, blue, alpha);see example
round(value);see example
rtrim(text);see example
save_external_data(file path, OFFSET variable);
save_local_storage(OFFSET variable);see example
save_session(OFFSET variable);
say(text);
[shows information per console]
screen_color(background color);see example
- color: hexadecimal or rgb(red, green, blue);
screen_copy(region file, graph, x, y, width, height);see example
screen_scanline(percentage);
- percentage: 0 (default) disables scanline; 100 is shown in greater darkness
screen_smooth(boolean);
- boolean: TRUE active blur, FALSE disables
send_socket(id socket, OFFSET variable);
set_author(page author);
set_center(file, graph, x, y);
set_color(background color);
- color: hexadecimal o rgb(red, green, blue);
set_description(page description);
set_fog(scene3d number, color, initial distance, final distance);see example
set_fps(number of frames per second, number of skips allowed);
set_half_scroll(scroll number, graph);see example
set_icon(file path);
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_point(file, graph, point number, x, y);
set_shadows(number, alpha, type);see example
set_song_pos(position of the module);
[fixes the position of the music module playback (the "pattern" number)]
set_terrain(number, file, graphic, distance, terrain height);see example
set_title(page title);
set_visible_mouse(boolean);see example
- boolean: display or hide the mouse system; TRUE is the default value
set_volume(volume);
- volume: 0-100 to increase or decrease the overall volume of the game
shadow_draw(id, color, x, y, blur);see example
- color: hexadecimal or rgb(red, green, blue);
shadow_in_object3d(3d object id, enable);see example
shadow_text(id, color, x, y, blur);see example
- color: hexadecimal or rgb(red, green, blue);
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
sort(variable, mode);
- mode:
0 for ascending order (from lowest to highest)
1 for descending order (from highest to lowest)
2 for random disorder.
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_capture_cam(number, region);see example
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_scene3d(number, file, graph, region);see example
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_capture_cam(number);see example
stop_mode7(number);
- number: mode7 number 0 to 9
stop_scene3d(number);
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]
subtract_draw(id, x, y, width, height);
subtract_text(id, x, y, width, height);
subtract_xdraw(id, x, y, width, height);
tan(value);
texture_in_map(file, graph, width, height, x, y, size_x, size_y);
texture_in_object3d(id, file, graph);
time(time variable);see example
- time variable:
t_milliseconds // returns the numeric value of the millisecond
t_seconds // returns the numeric value of the second
t_minutes // returns the numeric value of the minutes
t_hours // returns the numeric value of the hours
trim(text);see example
unique(variable);see example
[returns the values of a filter array without duplicate values]
unload_font(id);
unload_fpg(id);
unload_image(id);
unload_song(identifier of the module);see example
unload_sound(sound id);
unload_video(video id);
upper(char or text);see example
[returns uppercase texts]
vibration(time);
video(video id, volume, frequency);
- video id: returned by the video file loaded with load_video();
- volume: 0 for minimum volume, 256 for maximum volume
- frequency: 256 is the standard rate
video_in_object3d(3d object id, video code, volume, frequency);
- video code: returned by the video file loaded with load_video();
- volume: 0 for minimum volume, 256 for maximum volume
- frequency: 256 is the standard rate
wave_in_map(file, graph, orientation, amplitude, variation);
- orientation: 0 horizontal, 1 vertical
- amplitude: separation of waves: 0 without separation, 1 for 1px of separate, 2 for 2px... 10px... in forward
- variation of -100 to 100 to change the size of the pixel, with 0 being the normal size and the largest size 100
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_html(font, centering code, text);see example
- font: id returned by load_font()
- centering code: 0 to 8
- text: "write text with support html tags"
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
write_object3d(id font, wireframe, color, alpha, height, x, y, z, text);see example
xadvance(angle, distance);see example
- angle: from 0 to 360000
xdraw(file, graph, x, y, size, angle, alpha, region);
- file
- graph: fpg code graphic drawing
- x: position x
- y: position y
- size: size of the graphic
- angle: angle of the graphic
- alpha: opacity of the graphic
- region: region number defined with define_region();
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();