cocopon / tweakpane

:control_knobs: Compact GUI for fine-tuning parameters and monitoring value changes
https://tweakpane.github.io/docs/
MIT License
3.44k stars 86 forks source link

[Feature Request] Button Array Component #230

Closed brianjenkins94 closed 3 years ago

brianjenkins94 commented 3 years ago

An array of buttons that I can put images/icons/text on.

- or -

A way to put a number of button elements next to each other.


Seems like I need a custom button component (unless I can put an <img> tag in a button 🤔) and possibly a custom folder component (unless I could use a BladeRack?).

Not entirely sure. I'm digging through the source and loosely following along with this:

cocopon commented 3 years ago

That kind of view shoud be supported by the plugin system, but the current one is only for input/monitor bindings. So there is no way to add it at this point.

I have a plan to add a plugin system for this kind of components, maybe in the next major version.

Related: #180

msemtd commented 3 years ago

I have also had a try at making exactly this feature (except I was calling it a "toolbar") which I got working well with just jQuery hacking in version 1.6.1 but it all stopped working with the refactoring of buttons. I had a try of using the plugin system but got stuck there and pinned my tweakpane version at 1.6.1.

The hack is to add a placeholder button and then inject a span of little styled button images after it and hide the placeholder. I'll see if I can create a simple demo of it and then maybe it can be made to work with v2.4.0

cocopon commented 3 years ago

Just released 3.0.0, and now this kind of views are officially supported by the refined plugin system. You can refer resources listed below to make a plugin:

cocopon commented 3 years ago

Released a new plugin Essentials and it contains button grid component! Try it if you like: https://github.com/tweakpane/plugin-essentials

image