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

v3 release note #313

Closed cocopon closed 3 years ago

cocopon commented 3 years ago

Draft of migration guide:


Named exports

Tweakpane now uses named exports:

// Browser:
// v2
const pane = new Tweakpane();

// v3
const pane = new Tweakpane.Pane();
// import:
// v2
import Tweakpane from 'tweakpane';
const pane = new Tweakpane();

// v3
import {Pane} from 'tweakpane';
const pane = new Pane();

Input options

Color view for number input:

// v2
pane.addInput(params, 'foobar', {input: 'color.rgba'});

// v3
pane.addInput(params, 'foobar', {view: 'color', alpha: true});

Plain text view for color-like string input:

// v2
pane.addInput(params, 'foobar', {input: 'string'});

// v3
pane.addInput(params, 'foobar', {view: 'text'});

Plugin registration

Register a plugin to the pane instance explicitly:

// v2
import 'tweakpane-plugin-foobar';

// v3
import * as FoobarPlugin from 'tweakpane-plugin-foobar';
const pane = new Pane();
pane.registerPlugin(FoobarPlugin);

Theming

Misc

cocopon commented 3 years ago

Draft of changelog: