极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 19835|回复: 0

求助:processing中ControlP5库如何添加按钮属性

[复制链接]
发表于 2019-5-13 11:04:47 | 显示全部楼层 |阅读模式
下面是改了例程中的代码,运行没有问题,现在想添加隐藏属性如何实现:
import controlP5.*;
ControlP5 cp5;
void setup() {
  size(400,600);
  noStroke();
  cp5 = new ControlP5(this);  
  // create a new button with name 'buttonA'
  cp5.addButton("colorA")
     .setValue(0)
     .setPosition(100,100)
     .setSize(200,19)
     ;
}
void draw() {
  
}
public void colorA(int theValue) {
  println("a button event from colorA: "+theValue);

//  在这里加上隐藏按钮的语句(说明文档中这句代码如何实现隐藏  controlP5.Controller : Button hide() )
  
}

  



/*
下面是说明文档
a list of all methods available for the Button Controller
use ControlP5.printPublicMethodsFor(Button.class);
to print the following list into the console.

You can find further details about class Button in the javadoc.

Format:
ClassName : returnType methodName(parameter type)
*
*
*
controlP5.Controller : Button hide()
*
*
*
*/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-20 08:39 , Processed in 0.037586 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表