Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// @description child_attach(object, update_coords, update_scale, update_angle, update_alpha);
- /// @param object
- /// @param update_coords
- /// @param update_scale
- /// @param update_angle
- /// @param update_alpha
- var obj, upd, i;
- obj = argument[0];
- for (i = 1; i <= 4; i += 1)
- {
- upd[i] = 1;
- if i < argument_count upd[i] = argument[i];
- }
- if instance_exists(obj)
- {
- var parent; parent = id;
- with obj
- {
- if id != parent
- {
- var xp; xp = x-parent.x;
- var yp; yp = y-parent.y;
- x_add = xp;
- y_add = yp;
- parent.child[parent.children] = id;
- parent.children += 1;
- xscale_start = image_xscale;
- yscale_start = image_yscale;
- xscale = sign(image_xscale) * min( 1, abs(image_xscale) );
- yscale = sign(image_yscale) * min( 1, abs(image_yscale) );
- angle = image_angle;
- alpha = image_alpha;
- dir = point_direction(x, y, x + xp, y + yp);
- dis = point_distance(0, 0, xp/abs(other.xscale_start), yp/abs(other.yscale_start));
- x_offset = 0;
- y_offset = 0;
- update_coords = upd[1];
- update_scale = upd[2];
- update_angle = upd[3];
- update_alpha = upd[4];
- visible = other.visible;
- }
- }
- return child[children-1];
- }
- else return -1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement