We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi! I've a canvas with 400 aprox. elements (objects), each has a boolean state and i want to change that state by clicking on that object, i can achieve it by doing a dist from object x and y to mouse position. But looping over all the objects each time i click is a good choice? i think thats a perfomance flaw, i didnt try yet, but maybe in the future i want 1000 particles. The elements dont move, sorry for the english.
Thanks
Answers
Loop over all the objects when the mouse is pressed and calculate the distances. There should be no noticeable performance issue. Here's a sketch that runs about the same amount of work each click, but for 40000 objects (each pixel).
Thanks for your help! I'll do that.