ControlWindow
- description
- the purpose of a control window is to outsource controllers so that they dont need to be drawn into the actual processing window. to save cpu, a control window is not updated when not active, in focus. for the same reason the framerate is set to 15.
- +Example
import controlP5.*; ControlP5 controlP5; int myColorBackground = color(0,0,0); ControlWindow controlWindow; public int sliderValue = 40; void setup() { size(400,400); frameRate(25); controlP5 = new ControlP5(this); controlP5.setAutoDraw(false); controlWindow = controlP5.addControlWindow("controlP5window",100,100,400,200); controlWindow.setBackground(color(40)); Controller mySlider = controlP5.addSlider("sliderValue",0,255,40,40,100,10); mySlider.setWindow(controlWindow); controlP5.addSlider("sliderValue1",0,255,40,40,100,10); } void draw() { background(sliderValue); controlP5.draw(); } void keyPressed() { if(key==',') controlP5.window("controlP5window").hide(); if(key=='.') controlP5.window("controlP5window").show(); // controlWindow = controlP5.addControlWindow("controlP5window2",600,100,400,200); // controlP5.controller("sliderValue1").moveTo(controlWindow); }
- constructors
- Methods
- activateTab ( )
- activate a tab of a control window.
- add ( )
- add a tab to the control window.
- clear ( )
- clear the control window, delete all controllers from a control window.
- currentTab ( )
- get the current active tab of a control window.
- frameRate ( )
- set the frame rate of the control window.
- hide ( )
- hide the controllers and tabs of the ControlWindow.
- isMouseOver ( )
- returns true if the mouse is inside a controller. !!! doesnt work for groups yet.
- isUpdate ( )
- check the update status of a control window.
- isVisible ( )
- check if the content of the control window is visible.
- name ( )
- get the name of the control window.
- remove ( )
- remove a control window from controlP5.
- removeTab ( )
- remove a tab from a control window.
- setBackground ( )
- set the background color of the control window.
- setColorValue ( )
- set the color of the values.
- setUpdate ( )
- enable or disable the update function of a control window.
- setUpdateMode ( )
- set the draw mode of a control window. a separate control window is only updated when in focus. to update the context of the window continuously, use yourControlWindow.setUpdateMode(ControlWindow.NORMAL); otherwise use yourControlWindow.setUpdateMode(ControlWindow.ECONOMIC); for an economic, less cpu intensive update.
- show ( )
- show the controllers and tabs of the ControlWindow.
- tab ( )
- get a tab by name of a control window
- update ( )
- update all controllers contained in the control window if update is enabled.
- usage
- Web & Application
- related