A
axl_gmd
Guest
I have a little issue here.
I have a room with an asset layer with a sprite. I'd love to analyze the color of every single pixel of that sprite. So I create and object and in the draw event I let two for loops go like that:
But the code doesn't work at all. By debugging, the variable "col" doesn't change value, it is always 0.
What am I getting wrong?
Thanks in advance, I hope you understood what I said!
I have a room with an asset layer with a sprite. I'd love to analyze the color of every single pixel of that sprite. So I create and object and in the draw event I let two for loops go like that:
Code:
for (i=0;i<room_width;i++) {
for(j=0;j<room_height;j++) {
var col = draw_getpixel(i,j);
if (col == $FFFFFF) {
//do some stuff
} else if (col == $FF0000) {
// do other stuff
}
// etc
}
}
What am I getting wrong?
Thanks in advance, I hope you understood what I said!
Last edited by a moderator: