More about backgrounds

Besides loading them from files, you can also create your own backgrounds. To this end, press the button labeled Edit Background. A little built-in painting program opens in which you can create or change your background. Please realize that this is not a full-blown program. For more advanced editing tools use some paint program. There is one option that is particularly useful. In the Image menu you find a command Gradient Fill. This can be used to create some nice gradient backgrounds.

In advanced mode, the background property form has a number of advanced options.

The edges of backgrounds, in particular when made transparent, can look a bit blocky. To avoid this you can check the box labelled Smooth edges. In this case pixel at the edges of the background (that is, pixels that are neighbors to transparent pixels) are drawn partially transparent. This can make them look a lot nicer. (Don't use this when the backgrounds need to match up to form larger shapes because in that case a partially transparent line will appear between the parts.) The effect of this setting is only visible in the game, not in the editor!

During gameplay, backgrounds are turned into textures. Textures must be moved to video memory (on the graphics card) before they can be used. When the box Preload texture is checked this happens immediately when the game loads such that there will be no delay during the game. If you have lots of large backgrounds though that are not used in the beginning you might want to uncheck this option. Game Maker will then swap textures to video memory and back when required.

Sometimes you want to use a background as a set of tiles, that is, a collection of smaller images in one big image. When create the rooms you can then add these subimages at different places in the room. This is very useful for creating nice looking levels. To use a background as a tile set, check the box labelled Use as tile set. The form now changes to look as follows:

You can indicate a number of settings for the tile set. In particular you can indicate the width and height of each tile. (Only one size can be given, so better make sure that all tiles in the set have the same size. If you have different sizes, create two or more tile sets.) You can also indicate an offset where the top leftmost tile starts. Finally, a separation between the tiles (this is normally 0 or 1) can be indicated. For more information on using tiles, see the chapter on creating rooms.

A word of warning is required here. When you put separating borders between the sprites and use interpolation between pixels (see the global game settings) this can result in cracks between the tiles. Better make sure the pixels around the tiles actually match with the pixels just inside the tiles to avoid this.

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)