• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM draw_sprite_ext problem

Y

yasin

Guest
I have a day and night cycle in my game and every object gets a little darker if it gets late in night that works just fine!

the problem is it conflicts with my character color picking code.

here is my code:
Code:
image_blend = make_colour_rgb(255*global.platformalpha,255*global.platformalpha,255*global.platformalpha); //to make my player get darker in night
if (mouse_check_button(mb_left)){
        color = draw_getpixel(device_mouse_raw_x(0),device_mouse_raw_y(0)) // choosing color for my player
    };

draw_sprite_ext(obj_player,image_index,x,y,image_xscale,image_yscale,0,color,1)// I can only put the variable color or only the variable image_blend
how do I give my player the choosen color and make it go dark and light with the image_blend variable?
 
A

Aura

Guest
Make the player instance get darker after blending it to the chosen colour.

Also what method are you using to make things darker? I'd suggest using a surface (and possibly blend modes if you know how to) instead of manipulating the luminousity of each instance yourself.
 

BLang

Member
I'm guessing you wanna combine the two colours?
If that's what you wanna do, you can do
draw_sprite_ext(obj_player, image_index, x, y, image_xscale, image_yscale, 0, merge_color(image_blend, color, amt), 1);,
where amt is the ratio of the colour blend - 0 is completely image_blend, 1 is completely color and 0.5 is perfectly in the middle. You can also choose any other number between 0 and 1 for amt.
 
Top