-
Notifications
You must be signed in to change notification settings - Fork 90
exercise_6
The mouse support script indirectly introduced 'picking', looking for objects that exist at a certain position without having to manually keep track or iterate over existing ones yourself.
This short set dips into the functions image_hit, pick_items and image_mask_set.
Create an animated color surface that moves from the upper left corner to the lower right in 200 ticks. As part of a clock_pulse handler, use image_hit to check when it reaches the center of the window and print that it has been detected once.
Create 12 color surfaces and leave them positioned in the upper left corner but with ascending order. Use pick_items(0, 0) and dump the set. Change the call to pick items so that you only get the highest two elements.
Take the set from the previous exercise and change so that all matching items gets printed. Then somehow use image_mask_set to make it so that the fourth item never appears.