I would like to have an OCG button which, when pressed, cycles through a set of OCG layers.
I've tried using self-referencing OCG buttons, where each toggled the other (I tried with and without radiobtngrp). The main problem is that even when toggled off, the clickable areas still persist, so clicking can only toggle the uppermost button. Here is an example with 2 layers (but I'd like to have more if possible):
\documentclass{article}
\usepackage[tikz]{ocgx2}
\tikzstyle{button}=[minimum width=15mm, rounded corners, draw=white!50!black!100, bottom color=white]
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{ocg}[radiobtngrp=myRadioButtons]{OCG 0}{1}{1}
\node[button, hide ocg=1, show ocg=2] (n1) at (0,0) {$Button 1$};
\end{ocg}
\begin{ocg}[radiobtngrp=myRadioButtons]{OCG 1}{2}{0}
\node[button, hide ocg=2, show ocg=1] (n2) at (0.5,0){$Button 2$};
\end{ocg}
\end{tikzpicture}
\end{center}
\end{document}
Is it possible to make this work? Alternatively, would it be possible to create a single button with a counter associated to it that increments each time it is clicked, each time toggling on a particular layer?