Sprite: spr_image
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code: global.draw = 0
Draw Event:
execute code:
draw_self();
if(global.draw == 1){
global.cell=0;//set a counter to keep track of how many cells
for (i = 0; i < sprite_get_width(spr_image); i += 10)//create a loop 10 pixels a time
{
for (j = 0; j < sprite_get_height(spr_image); j += 10)
{
col=draw_getpixel(i,j);//get colour at position
global.data[global.cell,0]=col;//write colour to array
global.data[global.cell,1]=i;//write x cord
global.data[global.cell,2]=j;//write y cord
global.cell++;//increase counter
}
}
global.draw = 0
room_goto(room_show_image);
}
Information about object: obj_showSprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask: No Physics ObjectDraw Event:execute code: for (i = 0; i < global.cell; i+=1;)//create loop { draw_set_colour(global.data[i,0]);//get colour from position in array x_pos=global.data[i,1];//get x cords y_pos=global.data[i,2];//get y cords draw_rectangle(x_pos,y_pos,x_pos+10,y_pos+10,false);//draw rectangle } Information about object: obj_drawSprite: spr_button
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask: No Physics ObjectCreate Event:execute code: global.draw = 0Mouse Event for Left Released:execute code: global.draw = 1

0 Comments