Class: HorizonSharedCanvasSubLayer<P>
A sublayer of HorizonSharedCanvasLayer.
Type parameters
Name | Type |
---|---|
P | extends ComponentProps |
Hierarchy
↳
HorizonSharedCanvasSubLayer
Constructors
constructor
• new HorizonSharedCanvasSubLayer<P
>(props
): HorizonSharedCanvasSubLayer
<P
>
Creates an instance of a DisplayComponent.
Type parameters
Name | Type |
---|---|
P | extends ComponentProps |
Parameters
Name | Type | Description |
---|---|---|
props | P | The propertis of the component. |
Returns
HorizonSharedCanvasSubLayer
<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
Accessors
display
• get
display(): HorizonSharedCanvasInstance
This sublayer's shared canvas instance.
Returns
Throws
Error if this sublayer is not attached.
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:174
projection
• get
projection(): HorizonProjection
This sublayer's horizon projection.
Returns
Throws
Error if this sublayer is not attached.
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:161
Methods
attach
▸ attach(projection
, display
): void
Attaches this sublayer to a parent layer.
Parameters
Name | Type | Description |
---|---|---|
projection | HorizonProjection | The horizon projection used by this sublayer. |
display | HorizonSharedCanvasInstance | The canvas instance shared by this sublayer. |
Returns
void
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:203
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 sublayer is attached to a parent layer.
Returns
boolean
Whether this sublayer is attached to a parent layer.
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:186
isVisible
▸ isVisible(): boolean
Checks whether this sublayer is visible.
Returns
boolean
Whether this sublayer is visible.
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:194
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 sublayer is attached to its parent layer.
Returns
void
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:241
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
onProjectionChanged
▸ onProjectionChanged(projection
, changeFlags
): void
This method is called when this sublayer's horizon projection changes.
Parameters
Name | Type | Description |
---|---|---|
projection | HorizonProjection | This sublayer's horizon projection. |
changeFlags | number | The types of changes made to the projection. |
Returns
void
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:265
onSleep
▸ onSleep(): void
This method is called when this sublayer's parent layer is put to sleep.
Returns
void
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:255
onUpdated
▸ onUpdated(time
, elapsed
): void
This method is called once every update cycle after this sublayer's shared canvas instance has had a chance to be invalidated.
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/layers/HorizonSharedCanvasLayer.tsx:288
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/layers/HorizonSharedCanvasLayer.tsx:234
onWake
▸ onWake(): void
This method is called when this sublayer's parent layer is awakened.
Returns
void
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:248
render
▸ render(): null
| VNode
Renders the component.
Returns
null
| VNode
A JSX element to be rendered.
Overrides
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:293
setVisible
▸ setVisible(val
): void
Sets this sublayer's visibility.
Parameters
Name | Type | Description |
---|---|---|
val | boolean | Whether this sublayer should be visible. |
Returns
void
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:218
shouldInvalidate
▸ shouldInvalidate(time
, elapsed
): boolean
This method is called at the beginning of every update cycle to check whether this sublayer's shared canvas instance should be invalidated. If the canvas is already invalidated, then this method will not be called.
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
boolean
Whether this sublayer's shared canvas instance should be invalidated.
Defined in
src/sdk/components/horizon/layers/HorizonSharedCanvasLayer.tsx:277