question on an object's mask
#1
Posted 03 March 2012 - 07:58 PM
#2
Posted 03 March 2012 - 08:00 PM
#3
Posted 03 March 2012 - 08:06 PM
How can you can you have a unique mask for each sprite?No, if you change the sprite_index during an event, the mask change because every sprite is having is own mark. Heck you can even have a unique mask for each image in each sprite if you want!
#4
Posted 03 March 2012 - 08:09 PM
Edited by RangerX, 03 March 2012 - 08:09 PM.
#5
Posted 03 March 2012 - 08:11 PM
I mean each sprite. I don't mean going into the modify mask in the sprite's option. Like an irregular mask.For each sprite or for each image in a sprite?
#6
Posted 03 March 2012 - 08:13 PM
#7
Posted 03 March 2012 - 08:15 PM
Go onOk then stay on the first image and and press modify mask...
#8
Posted 03 March 2012 - 08:31 PM
When you click on your sprite and then click on "modify mask", you have the following options:
Image
This is where you change the current subimage that you see on the right with the button besides the "show" option. Leave it at image0 since you don't need a mask for each subimage.
Bounding Box
This is the "box" that will be around your mask. The bounding box is used by many functions to determine where another image should collide with it.
The options are pretty clear to me. You can even set the bounding box around your image manually.
General
Leave the little box unchecked and the alpha at 0 since you're not having a mask for each image.
Shape
This is the shape of your image's mask. Pretty explanatory too.
"Precise" means that the shape of your mask will be exact image minus the transparent pixels.
Edited by RangerX, 03 March 2012 - 08:32 PM.
#9
Posted 03 March 2012 - 08:40 PM
#10
Posted 03 March 2012 - 08:43 PM
#11
Posted 03 March 2012 - 08:49 PM
#12
Posted 03 March 2012 - 10:21 PM
He's not asking how to change the SPRITE'S mask, he's asking how to change the object's mask. As far as I know the object's mask doesn't change if you change the sprite, since they're two different object-local variables. But unless you really, really need to assign two sprites to an object (which is what you're doing with Object Mask), you'd be better off trying to tweak the object's sprite's bounding boxes to work better for you.
That's exactly what I mean, and if it doesn't change then my question is solved. Just another question though. Would the function "sprite_collision_mask" work too?If you add a mask to the object itself it stays the same no matter how many times you change the sprite but if you use the sprites individual mask (sprite editors mask) then yes it changes each time you change the sprite.
#13
Posted 03 March 2012 - 10:33 PM
You will regret it. Yes, it changes the sprite's bounding boxes, allowing you to essentially change the sprite mask on the fly, but 1) you probably haven't read my thread on the sprite_collision_mask() bug, and 2) ... well yeah, that's about all there is to it. Also, I don't know how fast the function is. I use it for a couple objects in my game, but it took me many hours to work the bugs out of it.
#14
Posted 03 March 2012 - 11:27 PM
Alright thanks guys!!!DO NOT USE THAT!
You will regret it. Yes, it changes the sprite's bounding boxes, allowing you to essentially change the sprite mask on the fly, but 1) you probably haven't read my thread on the sprite_collision_mask() bug, and 2) ... well yeah, that's about all there is to it. Also, I don't know how fast the function is. I use it for a couple objects in my game, but it took me many hours to work the bugs out of it.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











