Somone knows how to set a sprite mask to an object via scripting?(not by action eventing.)
Engine: Game Maker 8.0
In RPG Maker..
The only 'MASK' you can set in base ruby is src_rect (which is part of the sprite class). It however, only allows you to set a viewable rectangle of the source sprite, which is how characters are already drawn. If you want to apply to image mask etc, then you must do it via GDI calls etc. If you are referring to any other sort of mask, can you please explain yourself better?
In Other.. This entirely depends on what engine you are using and what that engine has access to. For example: Express Game Maker has direct access to all MS XNA operations, so creation can be pretty easy. But with things like say Game Makers GML script engine, it does not provide access to outside resources (to my knowledge) and is therefor far more limited. So if there was not a method already available for you to do so, then you would be out of luck.
Best of luck with this!
oh sorry, didn't noticed i hadn't put the engine it's Game Maker.
mask_id is what you want I think. Not sure if thats the name, but dont have GM installed here so I can't really tell.
If you're trying to change the collision mask of an object to a sprite resource in GML (we'll call it sprMask) you're looking for mask_index.
That is to say,
mask_index = sprMask;
is what you're looking for.