Multiple on-click actions scripting

noortjetw shared this question 4 years ago
Needs Answer

I wonder if it is possible, using the GeoGebra scripting, to make for instance a circle which if it is clicked on once, changes colour (from white to hatched preferably) and if it is clicked on again changes back to white/transparent.

So I bump into two problems when I try to make this:

1. I can only let it change to a solid colour (using the on-click script function SetFilling), not to hatched, as the hatching (in the Style tab) is not influenced by changing the opacity. is there anyway to do this?

2. If I click it once it changes from opacity 0 to opacity 100, so it becomes a solid colour. But how do I make sure the script doesn't end here? So I can click again and let it go back to opacity 0?

I hope anyone can help me out, thank you in advance!

© 2023 International GeoGebra Institute