Interface: TouchBackgroundProps
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchBackground/TouchBackground.tsx:10
Component props for TouchBackground.
Extends
Properties
children?
optionalchildren:DisplayChildren[]
Defined in: src/sdk/components/FSComponent.ts:125
The children of the display component.
Inherited from
class?
optionalclass: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?
optionalisEnabled: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?
optionalisVisible: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()?
optionalonHoldEnded: (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
| Parameter | Type | Description |
|---|---|---|
background | TouchBackground | The background that was held. |
totalHoldDuration | number | The total amount of time, in milliseconds, that the background was held. |
endReason | TouchButtonHoldEndReason | The reason that the background exited the held state. |
Returns
void
onHoldStarted()?
optionalonHoldStarted: (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
| Parameter | Type |
|---|---|
background | TouchBackground |
Returns
The action to take. Ignored if the value is equal to TouchButtonHoldAction.EndHold.
onHoldTick()?
optionalonHoldTick: (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
| Parameter | Type | Description |
|---|---|---|
background | TouchBackground | The background that is held. |
dt | number | The elapsed time, in milliseconds, since the previous frame. |
totalTime | number | The total amount of time, in milliseconds, that the background has been held. |
timeSinceLastPress | number | The amount of time, in milliseconds, that the background has been held since the last time the background was pressed as a tick action. |
Returns
The action to take.
onPressed()?
optionalonPressed: (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
| Parameter | Type | Description |
|---|---|---|
background | TouchBackground | The background that was pressed. |
isHeld | boolean | Whether the background was held when it was pressed. |
Returns
void
onTouched()?
optionalonTouched: (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
| Parameter | Type | Description |
|---|---|---|
background | TouchBackground | The background that was touched. |
Returns
The action to take as a result of the background being touched.
ref?
optionalref:NodeReference<any>
Defined in: src/sdk/components/FSComponent.ts:128
A reference to the display component.