GameMaker Manual - GameMaker.info (2024)

When running GameMaker in advanced mode theA number of advanced options exist. When you open the sprite form it will look as follows:

GameMaker Manual - GameMaker.info (1)

A new button Save Sprite has appeared. With this button you can save the spritein a proprietary format. This format will not only store the image(s) of the spritebut also other settings, such as collision settings and the origin. The file will havethe extension .gmspr. GameMaker can load such files but also the games canload them.

At the bottom-left, you can indicate the origin of the sprite. This is the point in thesprite that corresponds with its position in the room. When you set an instance at aparticular position, the origin of the sprite is placed there. Default itis the top left corner of the sprite but it is sometimes more convenientto use the center (by clicking the Center button)or some other important point. You can even choose anorigin outside the sprite. You can also set the origin by clicking in thesprite image. The origin will be shown with a cross.

Most important are the options related to collision checking. Whenever two instancesmeet a collision event is generated. Collisions are checked in the following way.Each sprite has a mask. Default this corresponds to all pixels that are not fully transparent.When two pixels in the masks of the two sprites overlap, a collision is reported.

Sometimes you don't want precise collision checking. In this case, uncheck thebox Precise collision checking. Now the bounding box is used as the mask.

When the sprites has multiple subimages, default there is just a single mask thatcombines the masks of all subimages. Normally this is what you want but in certainsituations you might want each subimage to have its own mask. In this case checkthe box Separate collision masks.

Collision Masks

If you want even more control overthe collision masks, press the button Modify Mask. The following windowwill show:

GameMaker Manual - GameMaker.info (2)

At the left top there is again the information about the sprite image. You canshow the different subimages. Also you can indicate here whether to show thecollision mask (default on). In this case, in the images at the right the maskis shown in dark. You can also zoom in and out to get a better view.

To the right of this you can change the bounding box. Only pixels inside this bounding box are used forthe mask. Default the bounding box is automatically computed, taking the alpha toleranceinto account, separate for each subimage, when using separate collision masks. You canalso set it to the full image or you can set it to manual. In the latter case you can specifythe bounding box yourself. When set to manual you can also draw the bounding box with theleft mouse button in the image, or you can move it with the right mouse button. (Note thoughthat the mask is shown while drawing, not the bounding box!)

Below this you can indicate the shape of the mask. Default is precise, pixel-wisecollision checking, but you can select here also to use the bounding rectangle, a disk (orellipse) inside it, or a diamond shape. Rectangles or disks are is many cases betterrepresentations of the shape. (Note that the choice has no effect on speed!)

Finally, at the left bottom you can (again) indicate whether or not there should be separatecollision masks for all subimages. (Note that if you set the bounding box manual,a single bounding box will be used for all subimages, regardless of this setting.)You can also indicate the tolerance with respect to the transparency. Witha higher tolerance also pixels that are partially transparent are left outsidethe mask. This influences both the bounding box (when not set to manual) and themask for precise collision checking.

It is important to carefully decide on the collision mask you use for your sprites.Although precise collision checking might seem the most logical option, in manycases game play is improved by using bounding boxes or disks, or masks that are abit smaller than the actual sprites. If you want even further control over the mask,note that for objects you can specify a different sprite to use as mask. In this wayyou can make the collision mask completely independent of the image.

Once you are done, press OK. If the mask was modified, the word Modified willshow in the sprite form such that you are reminded that you changed some settings here.

Editing Sprites

GameMaker has extensive possibilities to create and change your own sprites.Information about this can be found in the following pages:

Editing your sprites
Strips
Editing individual subimages

« Preferences | Editing your sprites »

GameMaker Manual - GameMaker.info (2024)

References

Top Articles
Latest Posts
Article information

Author: Annamae Dooley

Last Updated:

Views: 6399

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.