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.

ection,showback,showborder) With this function you can draw a<br />

healthbar (or any other bar that indicates some value, like e.g. the damage).<br />

The arguments x1, y1, x2 and y2 indicate the total area for the bar. amount<br />

indicates the percentage of the bar that must be filled (must lie between 0 and<br />

100). backcol is the color of the background for the bar. mincol and maxcol<br />

indicate the color when the amount is 0 and 100 respectively. For an amount<br />

in between the color is interpolated. So you can easily make a bar that goes<br />

e.g. from green to red. The direction is the direction in which the bar is drawn.<br />

0 indicates that the bar is anchored at the left, 1 at the right, 2 at the top and<br />

3 at the bottom. Finally showback indicates whether a background box must<br />

be shown and showborder indicated whether the box and bar should have a<br />

black border line.<br />

Most of the above functions use the color and alpha setting that can be changed <strong>with</strong> following<br />

functions.<br />

draw_set_color(col) Sets the drawing color to be used from now on for<br />

drawing primitives.<br />

draw_set_alpha(alpha) Sets the alpha transparency value to be used from<br />

now on for drawing primitives. Should lie in the range 0-1. 0 is fully<br />

transparent, 1 is fully opaque.<br />

draw_get_color() Returns the drawing color used for drawing primitives.<br />

draw_get_alpha() Returns the alpha value used for drawing primitives.<br />

A whole range of predefined colors is available:<br />

c_aqua<br />

c_black<br />

c_blue<br />

c_dkgray<br />

c_fuchsia<br />

c_gray<br />

c_green<br />

c_lime<br />

c_ltgray<br />

c_maroon

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

Saved successfully!

Ooh no, something went wrong!