// ============================================================================
// VARIABLES
var nro_images = 0;
var cur_image = 0;
// ============================================================================
// STRINGS & TEXT
string current_image = "#100";
text image_file
{
strings = 100;
}
// ============================================================================
// PANEL
panel image_pan
{
pos_x = 100;
pos_y = 100;
}
// ============================================================================
// FUNCTIONS
// sets the current_image string and updates the panel
function update_image()
{
str_cpy(current_image,"images\\");
str_cat(current_image,image_file.string[cur_image]);
image_pan.bmap = bmap_create(current_image);
image_pan.size_x = bmap_width(image_pan.bmap);
image_pan.size_y = bmap_height(image_pan.bmap);
}
// shows the next image
function cycle_imagesUp()
{
cur_image = cycle(cur_image+1,0,nro_images);
update_image();
}
// shows the previous image
function cycle_imagesDown()
{
cur_image = cycle(cur_image-1,0,nro_images);
update_image();
}
// loads the images with a specific format from a specific folder
function load_images()
{
nro_images = txt_for_dir(image_file,"images\\*.jpg");
update_image();
}
// ============================================================================
// END OF FILE
// ============================================================================