Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Set Object Mask(Via Scripting) [GM8]

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!
 
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.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top