1 |
if (transform_type == "in") |
2 |
{ |
3 |
if (no_loop_transform == false) |
4 |
{ |
5 |
sprite_width_end = sprite_width_destination / sprite_width |
6 |
sprite_height_end = sprite_height_destination / sprite_height |
7 |
var sprite_width_multiplier = abs(image_xscale - sprite_width_end) |
8 |
var sprite_height_multiplier = abs(image_yscale - sprite_height_end) |
9 |
if (sprite_width_end > image_xscale) |
10 |
width_increase_type = 1 |
11 |
else |
12 |
width_increase_type = 0 |
13 |
if (sprite_height_end > image_yscale) |
14 |
height_increase_type = 1 |
15 |
else |
16 |
height_increase_type = 0 |
17 |
max_frames = max_frames_default |
18 |
sprite_width_increase = sprite_width_multiplier / max_frames |
19 |
sprite_height_increase = sprite_height_multiplier / max_frames |
20 |
transform_direction = 2 |
21 |
no_loop_transform = true |
22 |
} |
23 |
if (transform_direction == 0 || transform_direction == 2) |
24 |
{ |
25 |
if (width_increase_type == 0) |
26 |
{ |
27 |
if (image_xscale > sprite_width_end) |
28 |
{ |
29 |
image_xscale -= sprite_width_increase |
30 |
if (image_xscale < sprite_width_end) |
31 |
image_xscale = sprite_width_end |
32 |
} |
33 |
} |
34 |
else if (width_increase_type == 1) |
35 |
{ |
36 |
if (image_xscale < sprite_width_end) |
37 |
{ |
38 |
image_xscale += sprite_width_increase |
39 |
if (image_xscale > sprite_width_end) |
40 |
image_xscale = sprite_width_end |
41 |
} |
42 |
} |
43 |
if (image_xscale == sprite_width_end && transform_direction != 2) |
44 |
transform_direction = 1 |
45 |
} |
46 |
if (transform_direction == 1 || transform_direction == 2) |
47 |
{ |
48 |
if (height_increase_type == 0) |
49 |
{ |
50 |
if (image_yscale > sprite_height_end) |
51 |
{ |
52 |
image_yscale -= sprite_height_increase |
53 |
if (image_yscale < sprite_height_end) |
54 |
image_yscale = sprite_height_end |
55 |
} |
56 |
} |
57 |
else if (height_increase_type == 1) |
58 |
{ |
59 |
if (image_yscale < sprite_height_end) |
60 |
{ |
61 |
image_yscale += sprite_height_increase |
62 |
if (image_yscale > sprite_height_end) |
63 |
image_yscale = sprite_height_end |
64 |
} |
65 |
} |
66 |
if (image_yscale == sprite_height_end && transform_direction != 2) |
67 |
transform_direction = 0 |
68 |
} |
69 |
} |
70 |
if (transform_type == "out") |
71 |
{ |
72 |
if (no_loop_transform == false) |
73 |
{ |
74 |
sprite_width_end = 1 |
75 |
sprite_height_end = 1 |
76 |
sprite_width_multiplier = abs(1 - image_xscale) |
77 |
sprite_height_multiplier = abs(1 - image_yscale) |
78 |
if (image_xscale > 1) |
79 |
width_increase_type = 1 |
80 |
else |
81 |
width_increase_type = 0 |
82 |
if (image_yscale > 1) |
83 |
height_increase_type = 1 |
84 |
else |
85 |
height_increase_type = 0 |
86 |
max_frames = max_frames_default |
87 |
sprite_width_increase = sprite_width_multiplier / max_frames |
88 |
sprite_height_increase = sprite_height_multiplier / max_frames |
89 |
transform_direction = 1 |
90 |
no_loop_transform = true |
91 |
} |
92 |
if (transform_direction == 0 || transform_direction == 2) |
93 |
{ |
94 |
if (width_increase_type == 1) |
95 |
{ |
96 |
if (image_xscale > sprite_width_end) |
97 |
{ |
98 |
image_xscale -= sprite_width_increase |
99 |
if (image_xscale < sprite_width_end) |
100 |
image_xscale = sprite_width_end |
101 |
} |
102 |
} |
103 |
else if (width_increase_type == 0) |
104 |
{ |
105 |
if (image_xscale < sprite_width_end) |
106 |
{ |
107 |
image_xscale += sprite_width_increase |
108 |
if (image_xscale > sprite_width_end) |
109 |
image_xscale = sprite_width_end |
110 |
} |
111 |
} |
112 |
if (image_xscale == sprite_width_end && transform_direction != 2) |
113 |
transform_direction = 1 |
114 |
} |
115 |
if (transform_direction == 1 || transform_direction == 2) |
116 |
{ |
117 |
if (height_increase_type == 1) |
118 |
{ |
119 |
if (image_yscale > sprite_height_end) |
120 |
{ |
121 |
image_yscale -= sprite_height_increase |
122 |
if (image_yscale < sprite_height_end) |
123 |
image_yscale = sprite_height_end |
124 |
} |
125 |
} |
126 |
else if (height_increase_type == 0) |
127 |
{ |
128 |
if (image_yscale < sprite_height_end) |
129 |
{ |
130 |
image_yscale += sprite_height_increase |
131 |
if (image_yscale > sprite_height_end) |
132 |
image_yscale = sprite_height_end |
133 |
} |
134 |
} |
135 |
if (image_yscale == sprite_height_end && transform_direction != 2) |
136 |
transform_direction = 0 |
137 |
} |
138 |
} |
139 |
if (transform_type != "nothing") |
140 |
{ |
141 |
if (image_xscale == sprite_width_end && image_yscale == sprite_height_end) |
142 |
{ |
143 |
if (transform_type == "out") |
144 |
{ |
145 |
with (obj_dialogue_box_battle) |
146 |
image_alpha = 1 |
147 |
instance_destroy() |
148 |
return; |
149 |
} |
150 |
transform_type = "nothing" |
151 |
no_loop_transform = false |
152 |
} |
153 |
} |