1 |
if (init == 0) |
2 |
{ |
3 |
if (use_pivot) |
4 |
{ |
5 |
if (pivotx == -999) |
6 |
pivotx = 0; |
7 |
if (pivoty == -999) |
8 |
pivoty = 0; |
9 |
startscalex = pivotx * image_xscale; |
10 |
startscaley = pivoty * image_yscale; |
11 |
} |
12 |
else |
13 |
{ |
14 |
if (pivotx == -999) |
15 |
pivotx = sprite_width / 2; |
16 |
if (pivoty == -999) |
17 |
pivoty = sprite_height / 2; |
18 |
} |
19 |
xrate *= scale; |
20 |
yrate *= scale; |
21 |
init = 1; |
22 |
if (reverse == 1) |
23 |
{ |
24 |
image_xscale += (xrate / fade); |
25 |
image_yscale += (yrate / fade); |
26 |
xrate *= -1; |
27 |
yrate *= -1; |
28 |
maxalpha = image_alpha; |
29 |
image_alpha = 0; |
30 |
fade *= -1; |
31 |
} |
32 |
exit; |
33 |
} |
34 |
maxalpha = clamp(maxalpha, 0, 1); |
35 |
image_alpha -= fade; |
36 |
image_xscale += xrate; |
37 |
image_yscale += yrate; |
38 |
if (use_pivot) |
39 |
{ |
40 |
xx = (x + (pivotx * image_xscale)) - startscalex; |
41 |
yy = (y + (pivoty * image_yscale)) - startscaley; |
42 |
} |
43 |
else |
44 |
{ |
45 |
xx = x - (pivotx * ((image_xscale - 2) / 2)); |
46 |
yy = y - (pivoty * ((image_yscale - 2) / 2)); |
47 |
} |
48 |
if (image_alpha < 0 || image_alpha > 1) |
49 |
instance_destroy(); |
50 |
d3d_set_fog(true, image_blend, 0, 1); |
51 |
draw_sprite_ext(sprite_index, image_index, xx, yy, image_xscale, image_yscale, 0, image_blend, image_alpha * maxalpha); |
52 |
d3d_set_fog(false, c_black, 0, 0); |