UNPKG

@thi.ng/imgui

Version:

Immediate mode GUI with flexible state handling & data only shape output

28 lines 1.38 kB
import type { Fn, Maybe } from "@thi.ng/api"; import type { IGridLayout } from "@thi.ng/layout"; import type { ReadonlyVec, Vec } from "@thi.ng/vectors"; import type { ComponentOpts } from "../api.js"; import type { IMGUI } from "../gui.js"; export interface XYPadOpts extends Omit<ComponentOpts, "layout"> { layout: IGridLayout<any>; min: ReadonlyVec; max: ReadonlyVec; step: number; value: Vec; /** * If `square` (default), the component will allocate a square, if `prop` an * area of proportional height (snapped to rows). If given a number > 0, the * component will occupy the given number of rows. */ mode?: "square" | "prop" | number; /** * If true (default), the top-right corner of the XY pad corresponds to the * configured {@link XYPadOpts.max} value. Otherwise, the bottom-right * corner is used. */ yUp?: boolean; fmt?: Fn<Vec, string>; } export declare const xyPad: ({ gui, layout, id, min, max, step, value, mode, yUp, label, info, fmt, }: XYPadOpts) => Maybe<Vec<number>>; export declare const xyPadRaw: (gui: IMGUI, id: string, x: number, y: number, w: number, h: number, min: Vec, max: Vec, step: number, val: Vec, yUp: boolean | undefined, labelX: number, labelY: number, label?: string, fmt?: Fn<Vec, string>, info?: string) => Maybe<Vec<number>>; //# sourceMappingURL=xypad.d.ts.map