Skip to main content

Interface: TouchBackgroundProps

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:10

Component props for TouchBackground.

Extends

Properties

children?

optional children: DisplayChildren[]

Defined in: src/sdk/components/FSComponent.ts:125

The children of the display component.

Inherited from

ComponentProps.children


class?

optional class: ClassProp

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:65

CSS class(es) to apply to the background's root element.


isEnabled?

optional isEnabled: boolean | Subscribable<boolean>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:18

Whether the background's touch function is enabled. Disabled backgrounds cannot be touched, primed, pressed, or held. Defaults to true.


isVisible?

optional isVisible: boolean | Subscribable<boolean>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:12

Whether the background is visible. Defaults to true.


onHoldEnded()?

optional onHoldEnded: (background, totalHoldDuration, endReason) => void

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:62

A function which is called when the background exits the held state. If not defined, then the background will default to taking no specific action when it exits the held state.

Parameters

ParameterTypeDescription
backgroundTouchBackgroundThe background that was held.
totalHoldDurationnumberThe total amount of time, in milliseconds, that the background was held.
endReasonTouchButtonHoldEndReasonThe reason that the background exited the held state.

Returns

void


onHoldStarted()?

optional onHoldStarted: (background) => TouchButtonHoldAction

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:41

A function which is called when the background enters the held state. If not defined, then the background will default to taking no specific action when it enters the held state.

Parameters

ParameterType
backgroundTouchBackground

Returns

TouchButtonHoldAction

The action to take. Ignored if the value is equal to TouchButtonHoldAction.EndHold.


onHoldTick()?

optional onHoldTick: (background, dt, totalTime, timeSinceLastPress) => TouchButtonHoldAction

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:53

A function which is called every frame when the background is held. If not defined, then the background will default to taking no specific action with each frame tick.

Parameters

ParameterTypeDescription
backgroundTouchBackgroundThe background that is held.
dtnumberThe elapsed time, in milliseconds, since the previous frame.
totalTimenumberThe total amount of time, in milliseconds, that the background has been held.
timeSinceLastPressnumberThe amount of time, in milliseconds, that the background has been held since the last time the background was pressed as a tick action.

Returns

TouchButtonHoldAction

The action to take.


onPressed()?

optional onPressed: (background, isHeld) => void

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:33

A function which is called every time the background is pressed.

Parameters

ParameterTypeDescription
backgroundTouchBackgroundThe background that was pressed.
isHeldbooleanWhether the background was held when it was pressed.

Returns

void


onTouched()?

optional onTouched: (background) => TouchButtonOnTouchedAction

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:26

A function which is called every time the background is touched (i.e. a mouse down event on the background is detected). If not defined, then the background will default to triggering a press event when touched.

Parameters

ParameterTypeDescription
backgroundTouchBackgroundThe background that was touched.

Returns

TouchButtonOnTouchedAction

The action to take as a result of the background being touched.


ref?

optional ref: NodeReference<any>

Defined in: src/sdk/components/FSComponent.ts:128

A reference to the display component.

Inherited from

ComponentProps.ref