changing parent sprite
#1
Posted 03 March 2012 - 09:10 PM
i want to have it so when I press down it changes the parent sprite and the actual sprite
and when I release down I want it to change back to the normal parent sprite. is this possible?
#2
Posted 03 March 2012 - 09:19 PM
#3
Posted 03 March 2012 - 09:36 PM
if keyboard_check(vk_down){object_set_parent(ind,obj)}
if keyboard_check_released(vk_down){object_set_parent(-1,obj) //Use -1 to not have a parent.
im doing something wrong
i have this in the down key event
{object_set_parent(parent1,obj_player)}
Edited by Fratrino, 03 March 2012 - 09:37 PM.
#4
Posted 03 March 2012 - 09:40 PM
or the mask with mask_index=spritename
sprite_index=spritename;//changes the actual sprite of the object thats calling the code
mask_index=spritename;//changes the sprites bounding box to the indicated sprites bounding boxes.(look up masks in help file of GM)
i think thats what your asking?
#5
Posted 03 March 2012 - 11:04 PM
changing an objects parent wont affect the sprites in the object you need to change the actual sprite with sprite_index=spritename
or the mask with mask_index=spritename
sprite_index=spritename;//changes the actual sprite of the object thats calling the code
mask_index=spritename;//changes the sprites bounding box to the indicated sprites bounding boxes.(look up masks in help file of GM)
i think thats what your asking?
wow i was mixing up parent with mask
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











