Topics:
Callback functions
Processing events: buttons, sliders, menus, mouse, keyboard
Make the following modifications to Assignment 2:
Define a button that changes the orientation of the red ellipse by 90 degrees.
Define a slider that changes the radius of the shaded circle. Be sure that the radius value is greater than zero.
Define a menu that allows the user to change the square's non-black color to another color. Give the user at least 4 choices.
Allow the user to change the color of the ellipse by typing a key, 'r' - red, 'g' - green, 'b' - blue, 'y' - yellow, 'p' - purple, 'w' - white.
When the user clicks with the left button, a small pentagon with a random color appears where s/he clicked. Each click adds a new pentagon, with the previous ones remaining.
The objects should update immediately and only in response to user input.
Add text to your web page that explains how the interaction works.
Your program should look something like this video.
Last modified January 25, 2024.