Div Games Online
logo Div Games Online

Documentation: Functions list of Div GO : Div Games Online v2.04.2

all functions (Div / Div 2 / Div GO) original functions (Div / Div 2) new functions (Div GO)
filter 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] [websocket]
search functions:  

291 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);
avg(array);see example
[returns the weighted average of the array values]
base64_decode(variable);see example
base64_encode(variable);see example
base64_to_graph(value);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
break_back_scroll(number, orientation, fragments, speed);see example
number: scroll number
orientation: 0 horizontal, 1 vertical
fragments: array with the different heights or widths of the scroll
speed: array with the displacement speeds of the different fragments
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_text(id, alpha, blur, tone, invert, grayscale);see example
change_tile_value(tilemap, graph to change, new graph);see example
change_tilemap(tilemap, scroll number);see example
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();
[returns empty array value, clear array of data]
clear_map(file, graph, x, y, width, height);see example
clear_map_put(file, graph1, graph2, x, y);see example
clear_map_xput(file, graph1, graph2, x, y, angle, size, flags);see example
clear_points(file, graph);see example
[clears all control points from a graph]
clear_screen();see example
clear_shadows(number);see example
clear_texture(3d object id);see example
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, size1, size2, debug);see example
- process id or type
- size1: size of the identified process
- size2: size of the calling process
- debug: show collision limits, only in ide
collision_circle(process id or TYPE process name, size1, size2, debug);see example
- process id or type
- size1: size of the identified process
- size2: size of the calling process
- debug: show collision limits, only in ide
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_song();
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_point(file, graph, number);see example
[delete the point indicated in the last parameter of the function]
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_bezier_curve(number, color, alpha, region);
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]
fix(value, digits);see example
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_dist_objects3d(id1, id2);
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);see example
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_tile(tilemap, x, y);see example
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);
graph_to_base64(graph);
graphic_builder(variable);see example
graphic_explorer(file, graph);see example
graphic_info(file, graph, information);see example
hsl(hue, saturation, lighting);see example
- 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);see example
- 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
max(value, value);see example
[returns the highest numeric value]
min(value, value);see example
[returns the lowest numeric value]
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);see example
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);
new_tilemap(id tilemap);see example
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();
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));see example
[searches for a route from the current process coordinates to a given point, avoiding obstacles created on a search map]
path_free(file, graph, scale, x, y);see example
path_line(file, graph, scale, x, y);see example
pause_song();
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
polytone(frequency, note, max volume position, min volume position, volume);see example
pop(variable);see example
[returns array with 1 less element at the end]
pow(value, value);
push(variable, value);see example
[returns array with 1 element inserted at the end]
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
[returns a random number between the minimum value and maximum value, including these]
rand_seed(numeric value);see example
[set a seed for the random number generator with the rand() function]
refresh_scroll(scroll number);
regex(type, text, expression, modifier, replacement);see example
- type:
0 o "s": search word
1 o "m": search for all similarities
2 o "r": search and replace
- text: text where to search
- expression: regular expression
- modifier (optional):
"g": global search
"i": search case insensitive
"m": multi-line search
"s": allows the . match newline characters
"u": unicode
- replacement (optional): replacement text
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_size(region, x, y, size_x, size_y);see example
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, type);see example
- percentage: 0 (default) disables scanline; 100 is shown in greater darkness
- type: 0 horizontal line; 1 vertical line; 2 grid
screen_smooth(boolean);
- boolean: TRUE active blur, FALSE disables
screen_transparent(boolean);see example
[removes the background color and shows content from behind the canvas]
set_author(page author);
set_background(file, graph, position, size, repeat);see example
- position:
0: up left, 1: up, 2: up right
3: left, 4: center, 5: right
6: down left, 7: down, 8: down right
- repeat:
0: no-repeat
1: repeat-x
2: repeat-y
3: repeat
set_bezier_curve(bezier number, bezier point x1, bezier point y1, bezier point x2, bezier point y2, x, y);
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);see example
set_shadows(number, alpha, type);see example
set_socket(id socket, variable);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_tile(tilemap, x, y, graph);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
set_vpad(boolean, alpha);see example
- boolean: TRUE turns on the virtual pad, FALSE turns it off
- alpha: 0 to 100 for opacity, with 100 being the most opaque value
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);
shift(variable);see example
[returns array with 1 element less from the start]
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
splice(variable, initial position, number of elements);
[returns an array with elements removed from a given position]
sqrt(value);
start_bezier_curve(bezier number, x, y);
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:
start_socket(url ws o wss(secure));see example
stop_bezier_curve(bezier number, type);
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);
sum(array);see example
[returns the sum of all values in the array]
tan(value);
texture_in_map(file, graph, width, height, x, y, size_x, size_y);see example
texture_in_object3d(id, file, graph);see example
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);
unshift(variable, value);see example
[returns array with 1 element inserted at the start]
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();