Class: HorizonLayer<P>
A base component for horizon layers.
Type parameters
Name | Type |
---|---|
P | extends HorizonLayerProps = HorizonLayerProps |
Hierarchy
↳
HorizonLayer
Constructors
constructor
• new HorizonLayer<P
>(props
): HorizonLayer
<P
>
Creates an instance of a DisplayComponent.
Type parameters
Name | Type |
---|---|
P | extends HorizonLayerProps = HorizonLayerProps |
Parameters
Name | Type | Description |
---|---|---|
props | P | The propertis of the component. |
Returns
HorizonLayer
<P
>
Inherited from
Defined in
src/sdk/components/FSComponent.ts:73
Properties
context
• Optional
context: [] = undefined
The context on this component, if any.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:64
contextType
• Optional
Readonly
contextType: readonly [] = undefined
The type of context for this component, if any.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:67
props
• props: P
& ComponentProps
The properties of the component.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:61
Methods
destroy
▸ destroy(): void
Destroys this component.
Returns
void
Inherited from
Defined in
src/sdk/components/FSComponent.ts:98
getContext
▸ getContext(context
): never
Gets a context data subscription from the context collection.
Parameters
Name | Type | Description |
---|---|---|
context | never | The context to get the subscription for. |
Returns
never
The requested context.
Throws
An error if no data for the specified context type could be found.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:106
isAttached
▸ isAttached(): boolean
Checks whether this layer is attached to a horizon component.
Returns
boolean
Whether this layer is attached to a horizon component.
Defined in
src/sdk/components/horizon/HorizonLayer.ts:31
isVisible
▸ isVisible(): boolean
Checks whether this layer is visible.
Returns
boolean
whether this layer is visible.
Defined in
src/sdk/components/horizon/HorizonLayer.ts:39
onAfterRender
▸ onAfterRender(node
): void
A callback that is called after the component is rendered.
Parameters
Name | Type | Description |
---|---|---|
node | VNode | The component's VNode. |
Returns
void
Inherited from
DisplayComponent.onAfterRender
Defined in
src/sdk/components/FSComponent.ts:87
onAttached
▸ onAttached(): void
This method is called when this layer is attached to its parent horizon component.
Returns
void
Defined in
src/sdk/components/horizon/HorizonLayer.ts:70
onBeforeRender
▸ onBeforeRender(): void
A callback that is called before the component is rendered.
Returns
void
Inherited from
DisplayComponent.onBeforeRender
Defined in
src/sdk/components/FSComponent.ts:80
onDetached
▸ onDetached(): void
This method is called when this layer is detached from its parent horizon component.
Returns
void
Defined in
src/sdk/components/horizon/HorizonLayer.ts:115
onProjectionChanged
▸ onProjectionChanged(projection
, changeFlags
): void
This method is called when this layer's horizon projection changes.
Parameters
Name | Type | Description |
---|---|---|
projection | HorizonProjection | This layer's horizon projection. |
changeFlags | number | The types of changes made to the projection. |
Returns
void
Defined in
src/sdk/components/horizon/HorizonLayer.ts:98
onSleep
▸ onSleep(): void
This method is called when this layer's parent horizon component is put to sleep.
Returns
void
Defined in
src/sdk/components/horizon/HorizonLayer.ts:88
onUpdated
▸ onUpdated(time
, elapsed
): void
This method is called once every update cycle.
Parameters
Name | Type | Description |
---|---|---|
time | number | The current time as a UNIX timestamp in milliseconds. |
elapsed | number | The elapsed time, in milliseconds, since the last update. |
Returns
void
Defined in
src/sdk/components/horizon/HorizonLayer.ts:108
onVisibilityChanged
▸ onVisibilityChanged(isVisible
): void
This method is called when this layer's visibility changes.
Parameters
Name | Type | Description |
---|---|---|
isVisible | boolean | Whether the layer is now visible. |
Returns
void
Defined in
src/sdk/components/horizon/HorizonLayer.ts:63
onWake
▸ onWake(): void
This method is called when this layer's parent horizon component is awakened.
Returns
void
Defined in
src/sdk/components/horizon/HorizonLayer.ts:81
render
▸ render(): null
| VNode
Renders the component.
Returns
null
| VNode
A JSX element to be rendered.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:93
setVisible
▸ setVisible(val
): void
Sets this layer's visibility.
Parameters
Name | Type | Description |
---|---|---|
val | boolean | Whether this layer should be visible. |
Returns
void
Defined in
src/sdk/components/horizon/HorizonLayer.ts:47