The current value of the rotary encoder is parameter 1 of the take over display callback.
Copied from the takeOverDisplay example shipped with tcMenu library :
What you'd normally do is to set the encoders range of possible values directly upon taking over the display, then every time you are called to draw the screen, the encoder value and button state are provided.
void myDisplayFunction(unsigned int encoderValue, RenderPressMode clicked)
Rotary encoder for the volume/input/balance functions within main screen
you can access menu items programatically, take a look in the _menu.h file and you see they are all declared there. Writing a complex custom renderer though is probably outside the scope of a forum post.
I recommend that you look through the examples, as several of them have different ways to deal with taking over the display.
I think an example serves to help out here, lets imagine you have a menu called menuVolume and you wanted to control it with the encoder during the take over display callback, this is all that would be required (apart from drawing of course!):
void weNeedToTakeOverScreen() {
renderer.takeOverDisplay(myDisplayCallback);
switches.changeEncoderPrecision(menuVolume.getMaximumValue(), menuVolume.getCurrentValue();
}
void myDisplayCallback(unsigned int encoderValue, RenderPressMode clicked) {
if(clicked) {
renderer.giveBackDisplay();
}
menuVolume.setCurrentValue(encoderValue); // it only updates if it has changed, so safe to keep calling\
// your rendering would go here!
}