@galacean/effects-plugin-gui 2.10.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +33 -0
- package/dist/components/gui-window-component.d.ts +15 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/ui-canvas.d.ts +28 -0
- package/dist/components/ui-control.d.ts +40 -0
- package/dist/controls/base-button.d.ts +85 -0
- package/dist/controls/button.d.ts +44 -0
- package/dist/controls/check-button.d.ts +10 -0
- package/dist/controls/checkbox.d.ts +12 -0
- package/dist/controls/color-picker.d.ts +59 -0
- package/dist/controls/color-rect.d.ts +11 -0
- package/dist/controls/enums.d.ts +68 -0
- package/dist/controls/index.d.ts +19 -0
- package/dist/controls/label.d.ts +46 -0
- package/dist/controls/line-edit.d.ts +28 -0
- package/dist/controls/menu-button.d.ts +39 -0
- package/dist/controls/nine-patch-rect.d.ts +35 -0
- package/dist/controls/panel.d.ts +9 -0
- package/dist/controls/popup-menu.d.ts +44 -0
- package/dist/controls/popup.d.ts +23 -0
- package/dist/controls/progress-bar.d.ts +19 -0
- package/dist/controls/slider.d.ts +63 -0
- package/dist/controls/text-edit.d.ts +21 -0
- package/dist/controls/text-input.d.ts +92 -0
- package/dist/controls/texture-rect.d.ts +30 -0
- package/dist/core/control.d.ts +379 -0
- package/dist/core/data.d.ts +88 -0
- package/dist/core/enums.d.ts +42 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/roots.d.ts +97 -0
- package/dist/core/theme.d.ts +186 -0
- package/dist/data.d.ts +147 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +10886 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +8 -0
- package/dist/index.min.js.map +1 -0
- package/dist/index.mjs +10858 -0
- package/dist/index.mjs.map +1 -0
- package/dist/layout/aspect-ratio-container.d.ts +26 -0
- package/dist/layout/box-container.d.ts +35 -0
- package/dist/layout/center-container.d.ts +15 -0
- package/dist/layout/enums.d.ts +15 -0
- package/dist/layout/grid-container.d.ts +19 -0
- package/dist/layout/margin-container.d.ts +10 -0
- package/dist/layout/panel-container.d.ts +10 -0
- package/dist/layout/separator.d.ts +19 -0
- package/dist/layout/utils.d.ts +10 -0
- package/dist/plugin/gui-plugin.d.ts +8 -0
- package/dist/plugin/index.d.ts +1 -0
- package/dist/scroll/enums.d.ts +8 -0
- package/dist/scroll/range.d.ts +56 -0
- package/dist/scroll/scroll-bar.d.ts +69 -0
- package/dist/scroll/scroll-container.d.ts +84 -0
- package/dist/theme/default-theme.d.ts +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/package.json +36 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Engine, EventEmitterListener, InputEventKey, math } from '@galacean/effects';
|
|
2
|
+
import type { Control } from '../core/control';
|
|
3
|
+
import { PanelContainer } from '../layout/panel-container';
|
|
4
|
+
export type PopupEvent = {
|
|
5
|
+
popupOpened: [];
|
|
6
|
+
popupClosed: [];
|
|
7
|
+
};
|
|
8
|
+
export declare abstract class Popup extends PanelContainer {
|
|
9
|
+
static readonly themeType: string;
|
|
10
|
+
private readonly popupEventEmitter;
|
|
11
|
+
constructor(engine: Engine);
|
|
12
|
+
onPopup<E extends keyof PopupEvent>(eventName: E, listener: EventEmitterListener<PopupEvent[E]>): void;
|
|
13
|
+
offPopup<E extends keyof PopupEvent>(eventName: E, listener: EventEmitterListener<PopupEvent[E]>): void;
|
|
14
|
+
popup(position: math.Vector2, source?: Control | null): void;
|
|
15
|
+
hidePopup(): void;
|
|
16
|
+
onKeyDown(event: InputEventKey): void;
|
|
17
|
+
onPopupOpened(): void;
|
|
18
|
+
onPopupClosed(): void;
|
|
19
|
+
onDestroy(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class PopupPanel extends Popup {
|
|
22
|
+
static readonly themeType: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { math } from '@galacean/effects';
|
|
2
|
+
import type { Engine } from '@galacean/effects';
|
|
3
|
+
import { Range } from '../scroll/range';
|
|
4
|
+
import { ProgressFillMode } from './enums';
|
|
5
|
+
import type { ProgressBarData } from '../data';
|
|
6
|
+
export declare class ProgressBar extends Range {
|
|
7
|
+
static readonly themeType: string;
|
|
8
|
+
private _showPercentage;
|
|
9
|
+
private _fillMode;
|
|
10
|
+
constructor(engine: Engine);
|
|
11
|
+
get showPercentage(): boolean;
|
|
12
|
+
set showPercentage(value: boolean);
|
|
13
|
+
get fillMode(): ProgressFillMode;
|
|
14
|
+
set fillMode(value: ProgressFillMode);
|
|
15
|
+
getMinimumSize(): math.Vector2;
|
|
16
|
+
getDesiredSize(): math.Vector2;
|
|
17
|
+
draw(): void;
|
|
18
|
+
fromData(data: ProgressBarData): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { math } from '@galacean/effects';
|
|
2
|
+
import type { Engine, EventEmitterListener, InputEventKey, InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch } from '@galacean/effects';
|
|
3
|
+
import type { RootControl } from '../core/control';
|
|
4
|
+
import { Orientation } from '../layout/enums';
|
|
5
|
+
import { Range } from '../scroll/range';
|
|
6
|
+
import type { RangeEvent } from '../scroll/range';
|
|
7
|
+
import type { SliderData } from '../data';
|
|
8
|
+
export type SliderEvent = RangeEvent & {
|
|
9
|
+
dragStarted: [];
|
|
10
|
+
dragEnded: [valueChanged: boolean];
|
|
11
|
+
};
|
|
12
|
+
export declare class Slider extends Range {
|
|
13
|
+
static readonly themeType: string;
|
|
14
|
+
private readonly sliderEventEmitter;
|
|
15
|
+
private _orientation;
|
|
16
|
+
private _editable;
|
|
17
|
+
private dragging;
|
|
18
|
+
private hovered;
|
|
19
|
+
private dragPosition;
|
|
20
|
+
private dragRatio;
|
|
21
|
+
private dragInitialValue;
|
|
22
|
+
private touchIndex;
|
|
23
|
+
scrollable: boolean;
|
|
24
|
+
constructor(engine: Engine, orientation?: Orientation);
|
|
25
|
+
get orientation(): Orientation;
|
|
26
|
+
get editable(): boolean;
|
|
27
|
+
set editable(value: boolean);
|
|
28
|
+
set orientation(value: Orientation);
|
|
29
|
+
on<E extends keyof SliderEvent>(eventName: E, listener: EventEmitterListener<SliderEvent[E]>): void;
|
|
30
|
+
off<E extends keyof SliderEvent>(eventName: E, listener: EventEmitterListener<SliderEvent[E]>): void;
|
|
31
|
+
getMinimumSize(): math.Vector2;
|
|
32
|
+
draw(): void;
|
|
33
|
+
onMouseEnter(): void;
|
|
34
|
+
onMouseMove(event: InputEventMouseMotion): void;
|
|
35
|
+
onMouseLeave(): void;
|
|
36
|
+
onMouseDown(event: InputEventMouseButton): void;
|
|
37
|
+
onMouseUp(event: InputEventMouseButton): void;
|
|
38
|
+
onTouchDown(event: InputEventScreenTouch): void;
|
|
39
|
+
onTouchMove(event: InputEventScreenDrag): void;
|
|
40
|
+
onTouchUp(event: InputEventScreenTouch): void;
|
|
41
|
+
onMouseWheel(event: InputEventMouseButton): void;
|
|
42
|
+
onKeyDown(event: InputEventKey): void;
|
|
43
|
+
onScrollBegin(): void;
|
|
44
|
+
protected onRootChanged(previousRoot: RootControl | null, nextRoot: RootControl | null): void;
|
|
45
|
+
private beginDrag;
|
|
46
|
+
private updateDrag;
|
|
47
|
+
private endDrag;
|
|
48
|
+
private getAxis;
|
|
49
|
+
private getAxisSize;
|
|
50
|
+
private getUsableLength;
|
|
51
|
+
private getRatioAt;
|
|
52
|
+
private getIncrement;
|
|
53
|
+
private getGrabberRect;
|
|
54
|
+
fromData(data: SliderData): void;
|
|
55
|
+
}
|
|
56
|
+
export declare class HSlider extends Slider {
|
|
57
|
+
static readonly themeType: string;
|
|
58
|
+
constructor(engine: Engine);
|
|
59
|
+
}
|
|
60
|
+
export declare class VSlider extends Slider {
|
|
61
|
+
static readonly themeType: string;
|
|
62
|
+
constructor(engine: Engine);
|
|
63
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { math } from '@galacean/effects';
|
|
2
|
+
import type { Engine, InputEventKey, InputEventMouseButton } from '@galacean/effects';
|
|
3
|
+
import type { TextEditData } from '../data';
|
|
4
|
+
import { TextInput } from './text-input';
|
|
5
|
+
export declare class TextEdit extends TextInput {
|
|
6
|
+
static readonly themeType: string;
|
|
7
|
+
protected readonly multiline = true;
|
|
8
|
+
private scrollLine;
|
|
9
|
+
constructor(engine: Engine, text?: string);
|
|
10
|
+
getMinimumSize(): math.Vector2;
|
|
11
|
+
getDesiredSize(): math.Vector2;
|
|
12
|
+
draw(): void;
|
|
13
|
+
onMouseWheel(event: InputEventMouseButton): void;
|
|
14
|
+
onKeyDown(event: InputEventKey): void;
|
|
15
|
+
protected getCharacterIndex(position: math.Vector2): number;
|
|
16
|
+
private measureLine;
|
|
17
|
+
private getVerticalCaretIndex;
|
|
18
|
+
private ensureCaretLineVisible;
|
|
19
|
+
protected onTextValueChanged(): void;
|
|
20
|
+
fromData(data: TextEditData): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Engine, EventEmitterListener, InputEventKey, InputEventMouseButton, InputEventMouseMotion, math } from '@galacean/effects';
|
|
2
|
+
import { Control } from '../core/control';
|
|
3
|
+
import type { ControlEvent } from '../core/control';
|
|
4
|
+
export type TextInputEvent = ControlEvent & {
|
|
5
|
+
textChanged: [text: string];
|
|
6
|
+
textSubmitted: [text: string];
|
|
7
|
+
};
|
|
8
|
+
export declare abstract class TextInput extends Control {
|
|
9
|
+
static readonly themeType: string;
|
|
10
|
+
protected abstract readonly multiline: boolean;
|
|
11
|
+
private readonly textEventEmitter;
|
|
12
|
+
private _text;
|
|
13
|
+
private _placeholderText;
|
|
14
|
+
private _editable;
|
|
15
|
+
private _maxLength;
|
|
16
|
+
private selectionStart;
|
|
17
|
+
private selectionEnd;
|
|
18
|
+
private selectionAnchor;
|
|
19
|
+
private selecting;
|
|
20
|
+
private selectingWords;
|
|
21
|
+
private wordSelectionStart;
|
|
22
|
+
private wordSelectionEnd;
|
|
23
|
+
private textarea;
|
|
24
|
+
private textareaFocusTimer;
|
|
25
|
+
private composing;
|
|
26
|
+
private readonly undoStack;
|
|
27
|
+
private readonly redoStack;
|
|
28
|
+
constructor(engine: Engine);
|
|
29
|
+
get text(): string;
|
|
30
|
+
set text(value: string);
|
|
31
|
+
get placeholderText(): string;
|
|
32
|
+
set placeholderText(value: string);
|
|
33
|
+
get editable(): boolean;
|
|
34
|
+
set editable(value: boolean);
|
|
35
|
+
get maxLength(): number;
|
|
36
|
+
set maxLength(value: number);
|
|
37
|
+
get caretColumn(): number;
|
|
38
|
+
set caretColumn(value: number);
|
|
39
|
+
get hasSelection(): boolean;
|
|
40
|
+
on<E extends keyof TextInputEvent>(eventName: E, listener: EventEmitterListener<TextInputEvent[E]>): void;
|
|
41
|
+
off<E extends keyof TextInputEvent>(eventName: E, listener: EventEmitterListener<TextInputEvent[E]>): void;
|
|
42
|
+
selectAll(): void;
|
|
43
|
+
deselect(): void;
|
|
44
|
+
getSelectedText(): string;
|
|
45
|
+
setSelection(start: number, end?: number): void;
|
|
46
|
+
onMouseDown(event: InputEventMouseButton): void;
|
|
47
|
+
onMouseMove(event: InputEventMouseMotion): void;
|
|
48
|
+
onMouseUp(event: InputEventMouseButton): void;
|
|
49
|
+
onKeyDown(event: InputEventKey): void;
|
|
50
|
+
onGotFocus(): void;
|
|
51
|
+
onLostFocus(): void;
|
|
52
|
+
onDestroy(): void;
|
|
53
|
+
protected getDisplayText(): string;
|
|
54
|
+
protected getSelectionRange(): [number, number];
|
|
55
|
+
protected moveCaret(index: number, extendSelection: boolean): void;
|
|
56
|
+
protected getTextFont(): import("@galacean/effects-plugin-gui").ThemeFont;
|
|
57
|
+
protected getTextFontSize(): number;
|
|
58
|
+
protected getTextColor(): math.Color;
|
|
59
|
+
protected getTextStyleBox(): import("@galacean/effects-plugin-gui").StyleBox;
|
|
60
|
+
protected drawTextBackground(): void;
|
|
61
|
+
protected drawSelection(x: number, y: number, width: number, height: number): void;
|
|
62
|
+
protected drawCaret(x: number, y: number, height: number): void;
|
|
63
|
+
protected abstract getCharacterIndex(position: math.Vector2): number;
|
|
64
|
+
protected onTextValueChanged(): void;
|
|
65
|
+
private setText;
|
|
66
|
+
private replaceSelection;
|
|
67
|
+
private erase;
|
|
68
|
+
private getLineStart;
|
|
69
|
+
private getLineEnd;
|
|
70
|
+
private submit;
|
|
71
|
+
private pushUndo;
|
|
72
|
+
private undo;
|
|
73
|
+
private redo;
|
|
74
|
+
private snapshot;
|
|
75
|
+
private restore;
|
|
76
|
+
private copySelection;
|
|
77
|
+
private pasteClipboard;
|
|
78
|
+
private getWordRange;
|
|
79
|
+
private activateTextarea;
|
|
80
|
+
private removeTextarea;
|
|
81
|
+
private syncTextareaSelection;
|
|
82
|
+
private scheduleTextareaFocus;
|
|
83
|
+
private cancelTextareaFocus;
|
|
84
|
+
private focusTextarea;
|
|
85
|
+
private readonly onBeforeInput;
|
|
86
|
+
private readonly onTextareaInput;
|
|
87
|
+
private readonly onTextareaSelect;
|
|
88
|
+
private readonly onCompositionStart;
|
|
89
|
+
private readonly onCompositionEnd;
|
|
90
|
+
private readonly onTextareaKeyDown;
|
|
91
|
+
private readonly onTextareaBlur;
|
|
92
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { math } from '@galacean/effects';
|
|
2
|
+
import type { Engine, Texture } from '@galacean/effects';
|
|
3
|
+
import { Control } from '../core/control';
|
|
4
|
+
import type { TextureRectData } from '../data';
|
|
5
|
+
import { TextureExpandMode, TextureStretchMode } from './enums';
|
|
6
|
+
export declare class TextureRect extends Control {
|
|
7
|
+
static readonly themeType: string;
|
|
8
|
+
private _texture;
|
|
9
|
+
private _expandMode;
|
|
10
|
+
private _stretchMode;
|
|
11
|
+
flipH: boolean;
|
|
12
|
+
flipV: boolean;
|
|
13
|
+
tint: math.Color;
|
|
14
|
+
constructor(engine: Engine, texture?: Texture | null);
|
|
15
|
+
get texture(): Texture | null;
|
|
16
|
+
set texture(value: Texture | null);
|
|
17
|
+
get expandMode(): TextureExpandMode;
|
|
18
|
+
set expandMode(value: TextureExpandMode);
|
|
19
|
+
get stretchMode(): TextureStretchMode;
|
|
20
|
+
set stretchMode(value: TextureStretchMode);
|
|
21
|
+
getMinimumSize(): math.Vector2;
|
|
22
|
+
getDesiredSize(): math.Vector2;
|
|
23
|
+
draw(): void;
|
|
24
|
+
private drawAspect;
|
|
25
|
+
private drawCovered;
|
|
26
|
+
private drawTiled;
|
|
27
|
+
private drawRegion;
|
|
28
|
+
private controlSizeChanged;
|
|
29
|
+
fromData(data: TextureRectData): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { math } from '@galacean/effects';
|
|
2
|
+
import type { Engine, EventEmitterListener, FontStyle, FontWeight, InputEventKey, InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch, NinePatchDrawOptions, TextMeasurement, Texture, TextureRegion, VFXItem } from '@galacean/effects';
|
|
3
|
+
import { EventEmitter } from '@galacean/effects';
|
|
4
|
+
import type { UIControl } from '../components/ui-control';
|
|
5
|
+
import type { ControlData } from './data';
|
|
6
|
+
import type { CursorStyle } from './enums';
|
|
7
|
+
import { FocusBehaviorRecursive, FocusMode, MouseBehaviorRecursive, MouseFilter } from './enums';
|
|
8
|
+
import { StyleBox } from './theme';
|
|
9
|
+
import type { Theme, ThemeFont } from './theme';
|
|
10
|
+
type Color = math.Color;
|
|
11
|
+
type Matrix3 = math.Matrix3;
|
|
12
|
+
type Vector2 = math.Vector2;
|
|
13
|
+
declare const Color: typeof math.Color;
|
|
14
|
+
declare const Matrix3: typeof math.Matrix3;
|
|
15
|
+
declare const Vector2: typeof math.Vector2;
|
|
16
|
+
export type Rect = {
|
|
17
|
+
position: Vector2;
|
|
18
|
+
size: Vector2;
|
|
19
|
+
};
|
|
20
|
+
/** Bit flags that describe how a Control uses space assigned by a Container. */
|
|
21
|
+
export declare enum SizeFlags {
|
|
22
|
+
ShrinkBegin = 0,
|
|
23
|
+
Fill = 1,
|
|
24
|
+
Expand = 2,
|
|
25
|
+
ShrinkCenter = 4,
|
|
26
|
+
ShrinkEnd = 8,
|
|
27
|
+
ExpandFill = 3
|
|
28
|
+
}
|
|
29
|
+
/** Direction in which a Control grows when a minimum size makes its requested rectangle larger. */
|
|
30
|
+
export declare enum GrowDirection {
|
|
31
|
+
Begin = 0,
|
|
32
|
+
End = 1,
|
|
33
|
+
Both = 2
|
|
34
|
+
}
|
|
35
|
+
export type LayoutPreset = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'centerLeft' | 'centerTop' | 'centerRight' | 'centerBottom' | 'center' | 'leftWide' | 'topWide' | 'rightWide' | 'bottomWide' | 'vcenterWide' | 'hcenterWide' | 'fullRect';
|
|
36
|
+
export type ControlEvent = {
|
|
37
|
+
locationChanged: [control: Control];
|
|
38
|
+
sizeChanged: [control: Control];
|
|
39
|
+
parentChanged: [control: Control];
|
|
40
|
+
minimumSizeChanged: [control: Control];
|
|
41
|
+
desiredSizeChanged: [control: Control];
|
|
42
|
+
maximumSizeChanged: [control: Control];
|
|
43
|
+
sizeFlagsChanged: [control: Control];
|
|
44
|
+
visibilityChanged: [control: Control];
|
|
45
|
+
enabledChanged: [control: Control];
|
|
46
|
+
themeChanged: [control: Control, affectsLayout: boolean];
|
|
47
|
+
};
|
|
48
|
+
export type RootControlEvent = ControlEvent & {
|
|
49
|
+
guiFocusChanged: [control: Control | null];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* A drawable GUI object. Controls form a tree independent from the VFXItem
|
|
53
|
+
* scene tree. UIControl is the bridge between both trees.
|
|
54
|
+
*/
|
|
55
|
+
export declare class Control {
|
|
56
|
+
static readonly themeType: string;
|
|
57
|
+
readonly engine: Engine;
|
|
58
|
+
/** Scene-tree bridge that owns this GUI object, if any. */
|
|
59
|
+
owner: UIControl | null;
|
|
60
|
+
readonly children: Control[];
|
|
61
|
+
readonly position: math.Vector2;
|
|
62
|
+
readonly size: math.Vector2;
|
|
63
|
+
readonly anchorMin: math.Vector2;
|
|
64
|
+
readonly anchorMax: math.Vector2;
|
|
65
|
+
readonly offsetMin: math.Vector2;
|
|
66
|
+
readonly offsetMax: math.Vector2;
|
|
67
|
+
readonly pivot: math.Vector2;
|
|
68
|
+
readonly scale: math.Vector2;
|
|
69
|
+
readonly shear: math.Vector2;
|
|
70
|
+
mouseForcePassScrollEvents: boolean;
|
|
71
|
+
clipContents: boolean;
|
|
72
|
+
private _parent;
|
|
73
|
+
private _visible;
|
|
74
|
+
private _enabled;
|
|
75
|
+
private _mouseFilter;
|
|
76
|
+
private _mouseBehaviorRecursive;
|
|
77
|
+
private _focusMode;
|
|
78
|
+
private _focusBehaviorRecursive;
|
|
79
|
+
private _defaultCursorShape;
|
|
80
|
+
private _rotation;
|
|
81
|
+
private transformDirty;
|
|
82
|
+
private readonly cachedTransform;
|
|
83
|
+
private readonly eventEmitter;
|
|
84
|
+
private disposed;
|
|
85
|
+
private readonly customMinimumSize;
|
|
86
|
+
private readonly customMaximumSize;
|
|
87
|
+
private minimumSizeCache;
|
|
88
|
+
private desiredSizeCache;
|
|
89
|
+
private maximumSizeCache;
|
|
90
|
+
private pendingMeasurementChanges;
|
|
91
|
+
private _horizontalSizeFlags;
|
|
92
|
+
private _verticalSizeFlags;
|
|
93
|
+
private _stretchRatio;
|
|
94
|
+
private _horizontalGrowDirection;
|
|
95
|
+
private _verticalGrowDirection;
|
|
96
|
+
private _theme;
|
|
97
|
+
private themeOwnerNode;
|
|
98
|
+
private _themeTypeVariation;
|
|
99
|
+
private readonly themeOverrides;
|
|
100
|
+
private readonly themeCache;
|
|
101
|
+
private readonly overrideStyleBoxReferences;
|
|
102
|
+
private readonly attachedThemeChanged;
|
|
103
|
+
private readonly overrideStyleBoxChanged;
|
|
104
|
+
constructor(engine: Engine);
|
|
105
|
+
get parent(): Control | null;
|
|
106
|
+
set parent(value: Control | null);
|
|
107
|
+
/** Scene item exposed through the optional UIControl bridge. */
|
|
108
|
+
get item(): VFXItem | null;
|
|
109
|
+
get indexInParent(): number;
|
|
110
|
+
set indexInParent(value: number);
|
|
111
|
+
get visible(): boolean;
|
|
112
|
+
set visible(value: boolean);
|
|
113
|
+
get visibleInHierarchy(): boolean;
|
|
114
|
+
get enabled(): boolean;
|
|
115
|
+
set enabled(value: boolean);
|
|
116
|
+
get enabledInHierarchy(): boolean;
|
|
117
|
+
get mouseFilter(): MouseFilter;
|
|
118
|
+
set mouseFilter(value: MouseFilter);
|
|
119
|
+
get mouseBehaviorRecursive(): MouseBehaviorRecursive;
|
|
120
|
+
set mouseBehaviorRecursive(value: MouseBehaviorRecursive);
|
|
121
|
+
get focusMode(): FocusMode;
|
|
122
|
+
set focusMode(value: FocusMode);
|
|
123
|
+
get focusBehaviorRecursive(): FocusBehaviorRecursive;
|
|
124
|
+
set focusBehaviorRecursive(value: FocusBehaviorRecursive);
|
|
125
|
+
get defaultCursorShape(): CursorStyle;
|
|
126
|
+
set defaultCursorShape(value: CursorStyle);
|
|
127
|
+
get location(): Vector2;
|
|
128
|
+
set location(value: Vector2);
|
|
129
|
+
get rotation(): number;
|
|
130
|
+
get x(): number;
|
|
131
|
+
set x(value: number);
|
|
132
|
+
get y(): number;
|
|
133
|
+
set y(value: number);
|
|
134
|
+
get width(): number;
|
|
135
|
+
set width(value: number);
|
|
136
|
+
get height(): number;
|
|
137
|
+
set height(value: number);
|
|
138
|
+
get horizontalSizeFlags(): SizeFlags;
|
|
139
|
+
set horizontalSizeFlags(value: SizeFlags);
|
|
140
|
+
get verticalSizeFlags(): SizeFlags;
|
|
141
|
+
set verticalSizeFlags(value: SizeFlags);
|
|
142
|
+
get stretchRatio(): number;
|
|
143
|
+
set stretchRatio(value: number);
|
|
144
|
+
get horizontalGrowDirection(): GrowDirection;
|
|
145
|
+
set horizontalGrowDirection(value: GrowDirection);
|
|
146
|
+
get verticalGrowDirection(): GrowDirection;
|
|
147
|
+
set verticalGrowDirection(value: GrowDirection);
|
|
148
|
+
get root(): RootControl | null;
|
|
149
|
+
get isDisposed(): boolean;
|
|
150
|
+
/** Theme applied to this Control and inherited by its descendants. */
|
|
151
|
+
get theme(): Theme | null;
|
|
152
|
+
set theme(value: Theme | null);
|
|
153
|
+
/** Returns the nearest Theme currently inherited by this Control. */
|
|
154
|
+
getInheritedTheme(): Theme | null;
|
|
155
|
+
/** Returns the Control that owns the first Theme in this Control's inheritance chain. */
|
|
156
|
+
getThemeOwnerNode(): Control | null;
|
|
157
|
+
/** Returns whether this Control is affected by a Theme in its Control ancestry. */
|
|
158
|
+
hasThemeOwnerNode(): boolean;
|
|
159
|
+
/** Optional named type variation resolved before this Control's native theme type. */
|
|
160
|
+
get themeTypeVariation(): string;
|
|
161
|
+
set themeTypeVariation(value: string);
|
|
162
|
+
/** Stable theme type declared by the closest Control class that provides one. */
|
|
163
|
+
getThemeType(): string;
|
|
164
|
+
getThemeColor(name: string, themeType?: string): Color;
|
|
165
|
+
getThemeConstant(name: string, themeType?: string): number;
|
|
166
|
+
getThemeFont(name: string, themeType?: string): ThemeFont;
|
|
167
|
+
getThemeFontSize(name: string, themeType?: string): number;
|
|
168
|
+
getThemeIcon(name: string, themeType?: string): Texture | null;
|
|
169
|
+
getThemeStyleBox(name: string, themeType?: string): StyleBox;
|
|
170
|
+
hasThemeColor(name: string, themeType?: string): boolean;
|
|
171
|
+
hasThemeConstant(name: string, themeType?: string): boolean;
|
|
172
|
+
hasThemeFont(name: string, themeType?: string): boolean;
|
|
173
|
+
hasThemeFontSize(name: string, themeType?: string): boolean;
|
|
174
|
+
hasThemeIcon(name: string, themeType?: string): boolean;
|
|
175
|
+
hasThemeStyleBox(name: string, themeType?: string): boolean;
|
|
176
|
+
setThemeColorOverride(name: string, value: Color): void;
|
|
177
|
+
setThemeConstantOverride(name: string, value: number): void;
|
|
178
|
+
setThemeFontOverride(name: string, value: ThemeFont): void;
|
|
179
|
+
setThemeFontSizeOverride(name: string, value: number): void;
|
|
180
|
+
setThemeIconOverride(name: string, value: Texture | null): void;
|
|
181
|
+
setThemeStyleBoxOverride(name: string, value: StyleBox): void;
|
|
182
|
+
removeThemeColorOverride(name: string): void;
|
|
183
|
+
removeThemeConstantOverride(name: string): void;
|
|
184
|
+
removeThemeFontOverride(name: string): void;
|
|
185
|
+
removeThemeFontSizeOverride(name: string): void;
|
|
186
|
+
removeThemeIconOverride(name: string): void;
|
|
187
|
+
removeThemeStyleBoxOverride(name: string): void;
|
|
188
|
+
hasThemeColorOverride(name: string): boolean;
|
|
189
|
+
hasThemeConstantOverride(name: string): boolean;
|
|
190
|
+
hasThemeFontOverride(name: string): boolean;
|
|
191
|
+
hasThemeFontSizeOverride(name: string): boolean;
|
|
192
|
+
hasThemeIconOverride(name: string): boolean;
|
|
193
|
+
hasThemeStyleBoxOverride(name: string): boolean;
|
|
194
|
+
clearThemeOverrides(): void;
|
|
195
|
+
hasFocus(visibleOnly?: boolean): boolean;
|
|
196
|
+
drawStyleBox(styleBox: StyleBox, x: number, y: number, width: number, height: number): void;
|
|
197
|
+
on<E extends keyof ControlEvent>(eventName: E, listener: EventEmitterListener<ControlEvent[E]>): void;
|
|
198
|
+
off<E extends keyof ControlEvent>(eventName: E, listener: EventEmitterListener<ControlEvent[E]>): void;
|
|
199
|
+
addChild<T extends Control>(child: T): T;
|
|
200
|
+
removeChild(child: Control): void;
|
|
201
|
+
getChildIndex(child: Control): number;
|
|
202
|
+
setPosition(x: number, y: number, keepOffsets?: boolean): void;
|
|
203
|
+
setSize(width: number, height: number): void;
|
|
204
|
+
/** Atomically replaces the local rectangle while preserving the current anchors. */
|
|
205
|
+
setRect(rect: Rect): void;
|
|
206
|
+
setSizeFlags(horizontal: SizeFlags, vertical: SizeFlags): void;
|
|
207
|
+
/** Intrinsic minimum size supplied by a subclass. */
|
|
208
|
+
getMinimumSize(): Vector2;
|
|
209
|
+
/** Intrinsic preferred size supplied by a subclass. */
|
|
210
|
+
getDesiredSize(): Vector2;
|
|
211
|
+
/** Intrinsic maximum size supplied by a subclass. Negative components are unbounded. */
|
|
212
|
+
getMaximumSize(): Vector2;
|
|
213
|
+
getCombinedMinimumSize(): Vector2;
|
|
214
|
+
getCombinedMaximumSize(): Vector2;
|
|
215
|
+
/** Minimum size after resolving a conflicting maximum; the maximum wins. */
|
|
216
|
+
getBoundMinimumSize(): Vector2;
|
|
217
|
+
/** Desired size clamped to the resolved minimum and maximum constraints. */
|
|
218
|
+
getBoundDesiredSize(): Vector2;
|
|
219
|
+
setCustomMinimumSize(width: number, height: number): void;
|
|
220
|
+
setCustomMaximumSize(width: number, height: number): void;
|
|
221
|
+
updateMinimumSize(): void;
|
|
222
|
+
updateDesiredSize(): void;
|
|
223
|
+
updateMaximumSize(): void;
|
|
224
|
+
protected invalidateMeasurementChanges(changes: number): void;
|
|
225
|
+
setScale(x: number, y: number): void;
|
|
226
|
+
setRotation(degrees: number): void;
|
|
227
|
+
setShear(x: number, y: number): void;
|
|
228
|
+
setPivot(x: number, y: number): void;
|
|
229
|
+
setAnchorMin(x: number, y: number): void;
|
|
230
|
+
setAnchorMax(x: number, y: number): void;
|
|
231
|
+
setOffsetMin(x: number, y: number): void;
|
|
232
|
+
setOffsetMax(x: number, y: number): void;
|
|
233
|
+
getRect(): Rect;
|
|
234
|
+
getTransform2D(): Matrix3;
|
|
235
|
+
setAnchorsPreset(preset: LayoutPreset, keepOffsets?: boolean): void;
|
|
236
|
+
setOffsetsPreset(preset: LayoutPreset, margin?: number): void;
|
|
237
|
+
setAnchorsAndOffsetsPreset(preset: LayoutPreset, margin?: number): void;
|
|
238
|
+
getGlobalTransform2D(): Matrix3;
|
|
239
|
+
hasPoint(point: Vector2): boolean;
|
|
240
|
+
/** Whether input at a position in this Control's space may reach a direct child. */
|
|
241
|
+
intersectsChildContent(child: Control, position: Vector2): boolean;
|
|
242
|
+
getEffectiveMouseFilter(): MouseFilter;
|
|
243
|
+
getFocusModeWithOverride(): FocusMode;
|
|
244
|
+
getCursorShape(position: Vector2): CursorStyle;
|
|
245
|
+
focus(hideFocus?: boolean): void;
|
|
246
|
+
grabFocus(hideFocus?: boolean): void;
|
|
247
|
+
grabClickFocus(): void;
|
|
248
|
+
releaseFocus(): void;
|
|
249
|
+
warpMouse(position: Vector2): void;
|
|
250
|
+
/** Converts a window-space position into this control's local coordinates. */
|
|
251
|
+
makePositionLocal(position: Vector2): Vector2;
|
|
252
|
+
/** Gets the current mouse position transformed into this control's coordinates. */
|
|
253
|
+
getLocalMousePosition(): Vector2;
|
|
254
|
+
update(deltaTime: number): void;
|
|
255
|
+
draw(): void;
|
|
256
|
+
onDestroy(): void;
|
|
257
|
+
drawInternal(): void;
|
|
258
|
+
drawLine(x1: number, y1: number, x2: number, y2: number, color?: Color, thickness?: number): void;
|
|
259
|
+
drawPolyline(points: number[], color?: Color, thickness?: number): void;
|
|
260
|
+
drawBezier(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, thickness?: number): void;
|
|
261
|
+
drawTriangle(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, color?: Color, thickness?: number): void;
|
|
262
|
+
drawRect(x: number, y: number, width: number, height: number, color?: Color, thickness?: number): void;
|
|
263
|
+
drawCircle(cx: number, cy: number, radius: number, color?: Color, thickness?: number): void;
|
|
264
|
+
fillTriangle(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, color?: Color): void;
|
|
265
|
+
fillRect(x: number, y: number, width: number, height: number, color?: Color): void;
|
|
266
|
+
fillCircle(cx: number, cy: number, radius: number, color?: Color): void;
|
|
267
|
+
drawTexture(x: number, y: number, width: number, height: number, texture: Texture, region?: TextureRegion, color?: Color): void;
|
|
268
|
+
drawNinePatch(x: number, y: number, width: number, height: number, texture: Texture, options: NinePatchDrawOptions, color?: Color): void;
|
|
269
|
+
drawText(x: number, y: number, text: string, fontSize: number, color?: Color, fontFamily?: string, fontWeight?: FontWeight, fontStyle?: FontStyle): void;
|
|
270
|
+
measureText(text: string, fontSize: number, fontFamily?: string, fontWeight?: FontWeight, fontStyle?: FontStyle): TextMeasurement;
|
|
271
|
+
onMouseEnter(location: Vector2): void;
|
|
272
|
+
onMouseMove(event: InputEventMouseMotion): void;
|
|
273
|
+
onMouseLeave(): void;
|
|
274
|
+
onMouseWheel(event: InputEventMouseButton): void;
|
|
275
|
+
onMouseDown(event: InputEventMouseButton): void;
|
|
276
|
+
onMouseUp(event: InputEventMouseButton): void;
|
|
277
|
+
onTouchDown(event: InputEventScreenTouch): void;
|
|
278
|
+
onTouchMove(event: InputEventScreenDrag): void;
|
|
279
|
+
onTouchUp(event: InputEventScreenTouch): void;
|
|
280
|
+
onKeyDown(event: InputEventKey): void;
|
|
281
|
+
onKeyUp(event: InputEventKey): void;
|
|
282
|
+
onGotFocus(): void;
|
|
283
|
+
onLostFocus(): void;
|
|
284
|
+
onScrollBegin(): void;
|
|
285
|
+
onScrollEnd(): void;
|
|
286
|
+
dispose(): void;
|
|
287
|
+
protected drawChildren(): void;
|
|
288
|
+
protected onThemeChanged(affectsLayout: boolean): void;
|
|
289
|
+
protected onRootChanged(previousRoot: RootControl | null, nextRoot: RootControl | null): void;
|
|
290
|
+
protected getDragData(position: Vector2): unknown;
|
|
291
|
+
protected canDropData(position: Vector2, data: unknown): boolean;
|
|
292
|
+
protected dropData(position: Vector2, data: unknown): void;
|
|
293
|
+
private getThemeDependencies;
|
|
294
|
+
private getFallbackThemeDependencies;
|
|
295
|
+
private resolveThemeItem;
|
|
296
|
+
private getThemeFallback;
|
|
297
|
+
private setThemeOverride;
|
|
298
|
+
private removeThemeOverride;
|
|
299
|
+
private hasThemeOverride;
|
|
300
|
+
private retainOverrideStyleBox;
|
|
301
|
+
private releaseOverrideStyleBox;
|
|
302
|
+
private propagateThemeChanged;
|
|
303
|
+
private propagateThemeOwner;
|
|
304
|
+
private scheduleMeasurementChanges;
|
|
305
|
+
private applyBounds;
|
|
306
|
+
private markTransformDirty;
|
|
307
|
+
private getCachedMinimumSize;
|
|
308
|
+
private getCachedDesiredSize;
|
|
309
|
+
private getCachedMaximumSize;
|
|
310
|
+
private resolveBoundedAxis;
|
|
311
|
+
private assertGrowDirection;
|
|
312
|
+
private queuePendingLayouts;
|
|
313
|
+
private queuePendingMeasurements;
|
|
314
|
+
private notifyRootChanged;
|
|
315
|
+
private getParentRect;
|
|
316
|
+
private computeOffsets;
|
|
317
|
+
private computeAnchors;
|
|
318
|
+
private isMouseRecursiveEnabled;
|
|
319
|
+
private isFocusRecursiveEnabled;
|
|
320
|
+
fromData(data: ControlData): void;
|
|
321
|
+
private applyThemeOverridesFromData;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* A Control that automatically measures and arranges its child Controls.
|
|
325
|
+
* Concrete layout algorithms live in GUI plugin packages.
|
|
326
|
+
*/
|
|
327
|
+
export declare class Container extends Control {
|
|
328
|
+
static readonly themeType: string;
|
|
329
|
+
private sortPending;
|
|
330
|
+
private readonly childLayoutChanged;
|
|
331
|
+
private readonly ownSizeChanged;
|
|
332
|
+
constructor(engine: Engine);
|
|
333
|
+
/** Defers and coalesces a layout pass until the GUI update phase. */
|
|
334
|
+
queueSort(): void;
|
|
335
|
+
changeChildIndex(child: Control, newIndex: number): void;
|
|
336
|
+
addChildInternal(child: Control): void;
|
|
337
|
+
removeChildInternal(child: Control): void;
|
|
338
|
+
dispose(): void;
|
|
339
|
+
/**
|
|
340
|
+
* Applies size flags and strict container geometry to a child. Automatic
|
|
341
|
+
* layout owns anchors, rotation, scale and shear; pivot is intentionally kept.
|
|
342
|
+
*/
|
|
343
|
+
fitChildInRect(child: Control, rect: Rect): void;
|
|
344
|
+
/** Returns direct children that participate in layout. Disabled children still participate. */
|
|
345
|
+
protected getLayoutChildren(): Control[];
|
|
346
|
+
protected sortChildren(): void;
|
|
347
|
+
private bindChild;
|
|
348
|
+
private unbindChild;
|
|
349
|
+
private invalidateMeasurementsAndQueueSort;
|
|
350
|
+
private fitAxis;
|
|
351
|
+
}
|
|
352
|
+
/** Base class for GUI tree roots and input dispatchers. */
|
|
353
|
+
export declare abstract class RootControl extends Control {
|
|
354
|
+
protected readonly rootEventEmitter: EventEmitter<RootControlEvent>;
|
|
355
|
+
on<E extends keyof RootControlEvent>(eventName: E, listener: EventEmitterListener<RootControlEvent[E]>): void;
|
|
356
|
+
off<E extends keyof RootControlEvent>(eventName: E, listener: EventEmitterListener<RootControlEvent[E]>): void;
|
|
357
|
+
abstract queueLayout(container: Container): void;
|
|
358
|
+
abstract queueMeasurementChange(control: Control): void;
|
|
359
|
+
abstract getMousePosition(): Vector2;
|
|
360
|
+
abstract guiGetFocusOwner(): Control | null;
|
|
361
|
+
abstract guiControlHasFocus(control: Control, visibleOnly?: boolean): boolean;
|
|
362
|
+
abstract guiIsDragging(): boolean;
|
|
363
|
+
abstract guiGetDragData(): unknown;
|
|
364
|
+
abstract guiIsDragSuccessful(): boolean;
|
|
365
|
+
abstract guiCancelDrag(): void;
|
|
366
|
+
abstract cancelPointerInput(): void;
|
|
367
|
+
abstract cancelPointerPress(control: Control, touchIndex: number): void;
|
|
368
|
+
abstract grabControlFocus(control: Control, hideFocus?: boolean): void;
|
|
369
|
+
abstract grabControlClickFocus(control: Control): void;
|
|
370
|
+
abstract releaseControlFocus(control?: Control): void;
|
|
371
|
+
abstract warpControlMouse(position: Vector2): void;
|
|
372
|
+
abstract updateMouseCursorState(): void;
|
|
373
|
+
abstract controlStateChanged(control: Control): void;
|
|
374
|
+
abstract controlRemoved(control: Control): void;
|
|
375
|
+
abstract controlTreeChanged(): void;
|
|
376
|
+
abstract popupControl(control: Control, source: Control | null, position: Vector2): void;
|
|
377
|
+
abstract closePopupControl(control: Control): void;
|
|
378
|
+
}
|
|
379
|
+
export {};
|