set(layer[gallery_bg].visible,true);
set(layer[gallery_close].visible,true);
set(layer[gallery_photo]._index,0);
set(layer[gallery_photo].url, get(pic.photo[photo_0].url));
open_gallery_engine();wait(0.1);gallery_size(); wait(0.1);
set(layer[pic_backg].width, get(photowi));
set(layer[pic_backg].height, get(photohe));
wait(0.11);
set(layer[overlay].ondown,
set(layer[overlay].width, 100%);
set(layer[overlay].height, 100%);
set(layer[overlay].x, 0);
if(layer[gallery_photo]._index == 0,
draglayer_2();
,
if(layer[gallery_photo]._index == tmp_count2,
draglayer_3();
,
draglayer();
);
);
);
set(layer[bin].visible,true);
set(layer[gallery_bg].visible,false);
set(layer[gallery_close].visible,false);
set(layer[bin].visible,false);
set(a, get(layer[gallery_photo]._index));
sub(tmp_count,get(pic.photo.count),1);
if(layer[overlay].x LT -4,
tween(layer[bin].x, -110%,0.5,linear);
tween(layer[bin].alpha, 0,0.4,easeoutquad,WAIT);
set(layer[gallery_photo].visible,false);
set(layer[bin].visible,false);
set(layer[bin].x,110%);
set(layer[pic_loading].alpha,1);
inc(a);
move_in();
);
if(layer[overlay].x GT 4,
tween(layer[bin].x, 110%,0.5,easeoutquad);
tween(layer[bin].alpha, 0,0.5,easeoutquad,WAIT);
set(layer[gallery_photo].visible,false);
set(layer[bin].visible,false);
set(layer[bin].x,-110%);
set(layer[pic_loading].alpha,1);
dec(a);
move_in();
);
if(a LT pic.photo.count,
txtadd(_name, 'photo_', get(a));
set(layer[gallery_photo].url, get(pic.photo[get(_name)].url));
set(layer[gallery_photo]._index, get(a));
);
set(layer[bin].visible,true);
tween(layer[bin].alpha, 1,0.7,easeoutquad);
tween(layer[bin].x, 0,0.5,linear);
sub(tmp_count2,get(pic.photo.count),1);
set(layer[gallery_photo].url, (get(pic.photo[photo_0].url));
if(device.tablet, if(stagewidth LT stageheight, mul(stH, get(stageheight), 0.45);, mul(stH, get(stageheight), 0.7); ); );
if(device.mobile, if(stagewidth LT stageheight, mul(stH, get(stageheight), 0.45);, mul(stH, get(stageheight), 0.7); ); );
if(device.desktop, if(stagewidth LT stageheight, mul(stH, get(stageheight), 0.3);, mul(stH, get(stageheight), 0.7); ); );
div(tmp_rat, get(layer[gallery_photo].imageheight), get(stH));
div(photo_width, get(layer[gallery_photo].imagewidth),get(tmp_rat));
set(layer[gallery_photo].height, get(stH));
set(layer[gallery_photo].width, prop);
add(photowi, get(photo_width),20);
add(photohe, get(layer[gallery_photo].height),20);
set(layer[pic_backg].width, get(photowi));
set(layer[pic_backg].height, get(photohe));
set(layer[gallery_photo].alpha,1);
if(%1 != dragging,
copy(drag_currentx, x);
copy(drag_stagex, mouse.stagex);
set(drag_sx, +1);
draglayer(dragging);
,
if(pressed,
sub(dx, mouse.stagex, drag_stagex);
mul(dx, drag_sx);
add(x, drag_currentx, dx);
delayedcall(0, move();draglayer(dragging) );
);
);
if(%1 != dragging,
copy(drag_currentx, x);
copy(drag_stagex, mouse.stagex);
set(drag_sx, +1);
draglayer_2(dragging);
,
if(pressed,
sub(dx, mouse.stagex, drag_stagex);
if(dx LT 0,
add(x, drag_currentx, dx);
);
delayedcall(0, move();draglayer_2(dragging) );
);
);
if(%1 != dragging,
copy(drag_currentx, x);
copy(drag_stagex, mouse.stagex);
set(drag_sx, +1);
draglayer_3(dragging);
,
if(pressed,
sub(dx, mouse.stagex, drag_stagex);
if(dx GT 0,
add(x, drag_currentx, dx);
);
delayedcall(0, move();draglayer_3(dragging) );
);
);