• 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_getpixel not working

Y

yasin

Guest
hi all,

I'm trying to make my character change color depending on the pixel I clicked on and for that I use:

draw_getpixel(mouse_x,mouse_y);

but for some reason it gives me the wrong color??
I think there is a conflict with my view in the room 500x400

how do I fix this?
 
R

Rafsun82

Guest
It would be great if you upload your project somewhere then gimme link (maybe in pm).
 
Y

yasin

Guest
its nothing special its just:
Code:
draw event:

if (mouse_check_button(mb_left)){
        image_blend = draw_getpixel(mouse_x,mouse_y)
    };
my room view settings are:
view in room
X 0 W500
Y 0 H400

port on screen
X 0 W1000
Y 0 H800

obj follow
obj_player

hbor 500
vbor 400
 
P

PlayLight

Guest
Code:
image_blend = draw_getpixel( device_mouse_raw_x(0),  device_mouse_raw_y(0) );
 
I

icuurd12b42

Guest
because mouse_x and mouse_y are room relative and the function need the coord to be screen relative
 
Top