Jump to content


Photo

question on an object's mask


  • Please log in to reply
13 replies to this topic

#1 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 03 March 2012 - 07:58 PM

Hey guys, Everybody knows about how in the object's main screen there's the option to set it's mask. My question is when you change that does it stay even when changing sprites during events?
  • 0

#2 RangerX

RangerX

    GMC Member

  • GMC Member
  • 921 posts
  • Version:GM8.1

Posted 03 March 2012 - 08:00 PM

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!
  • 0

#3 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 03 March 2012 - 08:06 PM

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!

How can you can you have a unique mask for each sprite?
  • 0

#4 RangerX

RangerX

    GMC Member

  • GMC Member
  • 921 posts
  • Version:GM8.1

Posted 03 March 2012 - 08:09 PM

For each sprite or for each image in a sprite?

Edited by RangerX, 03 March 2012 - 08:09 PM.

  • 0

#5 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 03 March 2012 - 08:11 PM

For each sprite or for each image in a sprite?

I mean each sprite. I don't mean going into the modify mask in the sprite's option. Like an irregular mask.
  • 0

#6 RangerX

RangerX

    GMC Member

  • GMC Member
  • 921 posts
  • Version:GM8.1

Posted 03 March 2012 - 08:13 PM

Ok then stay on the first image and and press modify mask...
  • 0

#7 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 03 March 2012 - 08:15 PM

Ok then stay on the first image and and press modify mask...

Go on
  • 0

#8 RangerX

RangerX

    GMC Member

  • GMC Member
  • 921 posts
  • Version:GM8.1

Posted 03 March 2012 - 08:31 PM

Then all the options are there. I'm not sure what you don't understand, maybe explain your problem in more details if needed.
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.

  • 0

#9 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 4733 posts
  • Version:GM8

Posted 03 March 2012 - 08:40 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.
  • 1

#10 Jakyl11

Jakyl11

    GMC Member

  • GMC Member
  • 3109 posts
  • Version:GM:Studio

Posted 03 March 2012 - 08:43 PM

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.
  • 1

#11 RangerX

RangerX

    GMC Member

  • GMC Member
  • 921 posts
  • Version:GM8.1

Posted 03 March 2012 - 08:49 PM

hmmm, looks like I can't read indeed! :/
  • 0

#12 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

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.



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.

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?
  • 0

#13 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 4733 posts
  • Version:GM8

Posted 03 March 2012 - 10:33 PM

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.
  • 1

#14 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 03 March 2012 - 11:27 PM

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.

Alright thanks guys!!!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users