Help with arrays!
in
Programming Questions
•
2 years ago
Hey guys,
I am kinda new to processing and cant seem to work out how the array and ArrayList work. Basically i want to be able to create shapes with my mouse. So i click once and that sets 1 point, click again and that sets another point, then make a rectangle between those two points and have the X coordinates of each end of the rectangle put into an array so they can be read when needed. I need to be able to make multiple rectangles.
If anyone can give me some sample code or some advice on how to do this i would be greatly appreciated.
Thanks,
Calum.
I am kinda new to processing and cant seem to work out how the array and ArrayList work. Basically i want to be able to create shapes with my mouse. So i click once and that sets 1 point, click again and that sets another point, then make a rectangle between those two points and have the X coordinates of each end of the rectangle put into an array so they can be read when needed. I need to be able to make multiple rectangles.
If anyone can give me some sample code or some advice on how to do this i would be greatly appreciated.
Thanks,
Calum.
1