08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

does not matter.<br />

background_create_from_surface(id,x,y,w,h,transparent,smoot<br />

h,preload) Creates a background by copying the given area from the<br />

surface <strong>with</strong> the given id. This makes it possible to create any background you<br />

want. Draw the image on the surface using the drawing functions and next<br />

create a background from it. Note that alpha values are maintained the<br />

background.<br />

background_delete(ind) Deletes the background from memory, freeing<br />

the memory used.<br />

The following routine exists to change the appearance of a background.<br />

Fonts<br />

background_set_alpha_from_background(ind,back) Changes the<br />

alpha (transparancy) values in the background <strong>with</strong> index ind using the<br />

intensity values in the background back. This cannot be undone.<br />

It is possible to create, replace, and delete fonts during the game using the following<br />

functions. (Don't replace a font that is set as the current font or at least set it again<br />

afterwards.)<br />

font_add(name,size,bold,italic,first,last) Adds a new font and<br />

returns its index, indicating the name, size, whether it is bold or italic, and the<br />

first and last character that must be created.<br />

font_add_sprite(spr,first,prop,sep) Adds a new font and returns its<br />

index. The font is created from a sprite. The sprite should contain a subimage<br />

for each character. first indicate the index of the first character in the sprite.<br />

For example, use ord('0') if your sprite only contains the digits. prop<br />

indicates whether the font is proportional. In a proportional font, for each<br />

character the width of the bounding box is used as the character width.<br />

Finally, sep indicates the amount of white space that must separate the<br />

characters horizontally. A typical value would lie between 2 and 8 depending<br />

on the font size.<br />

font_replace(ind,name,size,bold,italic,first,last) Replaces<br />

the font ind <strong>with</strong> a new font, indicating the name, size, whether it is bold or<br />

italic, and the first and last character that must be created.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!