This seems a simple question, but I’m not able to solve the issue.
It is possible to rotate the controlP5 controllers? I need it exactly 90º CCW. But I’m unable to find the solution.
Possible options:
Use a rotate native controlP5 properties: it seems it does not exist.
Rotating the camera. By rotating the camera the target is lost and the selection of the different textfieds is not possible.
Paint the controlP5 inside a Pgraphics, canvas, or similar and rotate it, but I can not figure out how.
Rotate the final window?
I’m programming an interface that should to be rotated 90º because the final display will be rotated as well. The same display has to play some content that is already created with that purpose, so I can not rotate the output through the graphic card.
I imagine controlP5 registers its own draw() method and and will be drawn after your draw() loop (at this line).
In that case, override handleDraw(), rewriting it so that handleMethods("draw"); is called beforedraw();. You’ll then have the option to rotate/translate the CP5 elements separately to what’s drawn in your draw() method.
Or, if you’re going with 4. Rotate the final window, maybe copying the source for handleDraw() and adding rotating the whole canvas after handleMethods("draw"); would be enough.
You may have to overwrite to mouseX and mouseY with a logical position that adjusts for the rotation, so you can still interact properly with the rotated CP5 elements.
Micycle, thanks for your answer. Finally, I’ve figured out how to implement the rotation using controlP5 functions. That’s where I am. The issue now is I can not select the text field because the mouse coordinates seem different in the controlP5 environment. Anyway, I’m starting to realize is going to be easier to rotate the desktop and modify previously created.
I’ve got a almost complete gui sketch you can make use of if you want, it’s large though you could add a method or a class initializer to do the rotation. It isn’t as fully featured as g4p or control p5 and currently is pc only, but it includes menus tabs windows sliders and buttons.
Paulgoux thanks so much for the offering. However I had some issues with the touch screen rotation too, so I decided to keep all the GUI in the regular position.
Currently just the menus work, but I shall hopefully finish the rest of the stuff by the end of next week, I shall look into adding the functionality you are after as soon as I can.