Skip to main content

Knob

Examples#

Basic#

export function App() {    return (        <Window>            <DemoLayout height="80dpx">                <Knob                    text="volume"                    style={{ ringColor: new Vec4(0, 146, 255, 255 * 0.75) }}                    onChange={(sender) => {                        console.log(`value: ${sender.ValueGet()}`);                    }}                ></Knob>            </DemoLayout>        </Window>    );}

Usage:

knob basic

In console:

value: 0.004value: 0.013000000000000001value: 0.019000000000000003...

Note: The value range is [0,1].

API#

export interface IKnobComponentProps extends IComponentProps {    text: string;    style?: IKnobStyle;    onChange?: Parameters<IKnob['OnChange']>[0];}
export interface IKnobStyle extends IComponentStyle {    ringColor?: Vec4;}