gpt4 book ai didi

java - 如何在处理中删除先前绘制的 ControlP5 下拉列表

转载 作者:行者123 更新时间:2023-12-01 12:42:28 27 4
gpt4 key购买 nike

我在处理中编写了一个草图,它创建了 3 个节点,用户可以单击这些节点来显示下拉列表。有没有办法让下拉列表在外部鼠标单击或释放鼠标按钮时消失?我想我可以在“绘图”部分中调用背景,它会覆盖列表,但事实似乎并非如此,因为它们实际上不是绘图的一部分。谢谢!

最佳答案

查看文档(包含在库中)总是好的。

来自ConrolP5 developer's site

Show, hide, load, save Controllers that have been added to your sketch can be arranged in tabs and groups to keep your controller sets organized. All controllers are drawn on top of a processing sketch by default. Several key combinations allow you to show and hide the user interface, and to saved and loaded ControlP5 properties, ControlP5properties → example. The position of a controller can be adjusted during runtime by moving a controller while the ALT-key is pressed.

DropdownList 类继承自 ControllerGroup 类,它有一个方法:隐藏

 hide

public java.lang.Object hide()

Specified by:
hide in interface ControllerInterface

因此,要完成您想要的任务,您需要跟踪鼠标单击,然后定位要隐藏的特定项目。

关于java - 如何在处理中删除先前绘制的 ControlP5 下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24974745/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com