马赛克房间过渡效果
这个脚本的用法请参看:http://www.rpgchina.net/read-htm-tid-36698.html
其中 size 与 draw_clear 可以按喜好自由更改替换。
var surfaces, s_width, s_height, fraction;
surfaces = argument0;
surfaces = argument1;
s_width = argument2;
s_height = argument3;
fraction = argument4;
var max_size; max_size = 20;
var scale, tmp_surface, tw, th, sn, alpha;
scale = round(1 + (1 - abs(0.5 - fraction) * 2) * (max_size - 1));
tw = ceil(s_width / scale);
th = ceil(s_height / scale);
draw_clear( c_black );
tmp_surface = surface_create(tw, th);
for (sn = 0; sn < 2; sn += 1)
{
surface_set_target(tmp_surface);
draw_surface_stretched(surfaces, 0, 0, tw, th);
surface_reset_target();
alpha = cos(fraction * pi / 2);
if (sn == 1) alpha = 1 - alpha;
draw_surface_stretched_ext(tmp_surface, 0, 0, s_width, s_height, c_white, alpha);
}
surface_free(tmp_surface);
页:
[1]