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.

draw_set_blend_mode(mode) Indicates what blend mode to use. The<br />

following values are possible: bm_normal, bm_add, bm_subtract, and<br />

bm_max. Don't forget to reset the mode to normal after use because otherwise<br />

also other sprites and even the backgrounds are drawn <strong>with</strong> the new blend<br />

mode.<br />

draw_set_blend_mode_ext(src,dest) Indicates what blend mode to use<br />

for both the source and destination color. The new color is some factor times<br />

the source and another factor times the destination. These factors are set <strong>with</strong><br />

this function. To understand this, the source and destination both have as red,<br />

green, blue, and alpha component. So the source is (Rs, Gs, Bs, As) and the<br />

destination is (Rd, Gd, Bd, Ad). All are considered to lie between 0 and 1. The<br />

blend factors you can choose for source and destination are:<br />

• bm_zero: Blend factor is (0, 0, 0, 0).<br />

• bm_one: Blend factor is (1, 1, 1, 1).<br />

• bm_src_color: Blend factor is (Rs, Gs, Bs, As).<br />

• bm_inv_src_color: Blend factor is (1–Rs, 1–Gs, 1–Bs, 1–As).<br />

• bm_src_alpha: Blend factor is (As, As, As, As).<br />

• bm_inv_src_alpha: Blend factor is (1–As, 1–As, 1–As, 1–As).<br />

• bm_dest_alpha: Blend factor is (Ad, Ad, Ad, Ad).<br />

• bm_inv_dest_alpha: Blend factor is (1–Ad, 1–Ad, 1–Ad, 1–Ad).<br />

• bm_dest_color: Blend factor is (Rd, Gd, Bd, Ad).<br />

• bm_inv_dest_color: Blend factor is (1–Rd, 1–Gd, 1–Bd, 1–Ad).<br />

• bm_src_alpha_sat: Blend factor is (f, f, f, 1); f = min(As, 1–Ad).<br />

For example, the normal blending mode sets the source blending to<br />

bm_src_alpha and the destination blending to bm_inv_src_alpha. Don't forget<br />

to reset the mode to normal after use because otherwise also other sprites and<br />

even the backgrounds are drawn <strong>with</strong> the new blend mode.<br />

Drawing texture primitives is a bit of work but can lead to great results. You can even use it to<br />

make fake 3D games.<br />

Drawing Surfaces<br />

This functionality is only available in the Pro Edition of <strong>Game</strong> <strong>Maker</strong>.

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

Saved successfully!

Ooh no, something went wrong!