API Reference › Globals › TextWithBackground
# Class: TextWithBackground
# Hierarchy
Object3D
↳ TextWithBackground
# Index
# Constructors
# Properties
- animations
- castShadow
- children
- customDepthMaterial
- customDistanceMaterial
- frustumCulled
- id
- isObject3D
- layers
- matrix
- matrixAutoUpdate
- matrixWorld
- matrixWorldNeedsUpdate
- modelViewMatrix
- name
- normalMatrix
- onAfterRender
- onBeforeRender
- parent
- position
- quaternion
- receiveShadow
- renderOrder
- rotation
- scale
- topDown
- type
- up
- userData
- uuid
- visible
- DefaultMatrixAutoUpdate
- DefaultUp
# Methods
- add
- addEventListener
- applyMatrix4
- applyQuaternion
- attach
- clear
- clone
- copy
- dispatchEvent
- dispose
- getObjectById
- getObjectByName
- getObjectByProperty
- getWorldDirection
- getWorldPosition
- getWorldQuaternion
- getWorldScale
- hasEventListener
- localToWorld
- lookAt
- raycast
- remove
- removeEventListener
- rotateOnAxis
- rotateOnWorldAxis
- rotateX
- rotateY
- rotateZ
- setRotationFromAxisAngle
- setRotationFromEuler
- setRotationFromMatrix
- setRotationFromQuaternion
- toJSON
- translateOnAxis
- translateX
- translateY
- translateZ
- traverse
- traverseAncestors
- traverseVisible
- update
- updateMatrix
- updateMatrixWorld
- updateWorldMatrix
- worldToLocal
# Constructors
# constructor
+ new TextWithBackground(font
: Font): TextWithBackground
Overrides RoomleComponent.constructor
Defined in packages/configurator-core/src/utils/text-with-background.ts:37
Parameters:
Name | Type |
---|---|
font | Font |
Returns: TextWithBackground
# Properties
# animations
• animations: AnimationClip[]
Inherited from RoomleComponent.animations
Defined in node_modules/three/src/core/Object3D.d.ts:161
Array with animation clips.
default
[]
# castShadow
• castShadow: boolean
Inherited from RoomleComponent.castShadow
Defined in node_modules/three/src/core/Object3D.d.ts:137
Gets rendered into shadow map.
default
false
# children
• children: Object3D[]
Inherited from RoomleComponent.children
Defined in node_modules/three/src/core/Object3D.d.ts:57
Array with object's children.
default
[]
# customDepthMaterial
• customDepthMaterial: Material
Inherited from RoomleComponent.customDepthMaterial
Defined in node_modules/three/src/core/Object3D.d.ts:175
Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes. When shadow-casting with a DirectionalLight or SpotLight, if you are (a) modifying vertex positions in the vertex shader, (b) using a displacement map, (c) using an alpha map with alphaTest, or (d) using a transparent texture with alphaTest, you must specify a customDepthMaterial for proper shadows.
# customDistanceMaterial
• customDistanceMaterial: Material
Inherited from RoomleComponent.customDistanceMaterial
Defined in node_modules/three/src/core/Object3D.d.ts:180
Same as customDepthMaterial, but used with PointLight.
# frustumCulled
• frustumCulled: boolean
Inherited from RoomleComponent.frustumCulled
Defined in node_modules/three/src/core/Object3D.d.ts:149
When this is set, it checks every frame if the object is in the frustum of the camera. Otherwise the object gets drawn every frame even if it isn't visible.
default
true
# id
• id: number
Inherited from RoomleComponent.id
Defined in node_modules/three/src/core/Object3D.d.ts:29
Unique number of this object instance.
# isObject3D
• isObject3D: true
Inherited from RoomleComponent.isObject3D
Defined in node_modules/three/src/core/Object3D.d.ts:186
Used to check whether this or derived classes are Object3Ds. Default is true. You should not change this, as it is used internally for optimisation.
# layers
• layers: Layers
Inherited from RoomleComponent.layers
Defined in node_modules/three/src/core/Object3D.d.ts:126
default
new THREE.Layers()
# matrix
• matrix: Matrix4
Inherited from RoomleComponent.matrix
Defined in node_modules/three/src/core/Object3D.d.ts:103
Local transform.
default
new THREE.Matrix4()
# matrixAutoUpdate
• matrixAutoUpdate: boolean
Inherited from RoomleComponent.matrixAutoUpdate
Defined in node_modules/three/src/core/Object3D.d.ts:115
When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.
default
THREE.Object3D.DefaultMatrixAutoUpdate
# matrixWorld
• matrixWorld: Matrix4
Inherited from RoomleComponent.matrixWorld
Defined in node_modules/three/src/core/Object3D.d.ts:109
The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.
default
new THREE.Matrix4()
# matrixWorldNeedsUpdate
• matrixWorldNeedsUpdate: boolean
Inherited from RoomleComponent.matrixWorldNeedsUpdate
Defined in node_modules/three/src/core/Object3D.d.ts:121
When this is set, it calculates the matrixWorld in that frame and resets this property to false.
default
false
# modelViewMatrix
• modelViewMatrix: Matrix4
Inherited from RoomleComponent.modelViewMatrix
Defined in node_modules/three/src/core/Object3D.d.ts:92
default
new THREE.Matrix4()
# name
• name: string
Inherited from RoomleComponent.name
Defined in node_modules/three/src/core/Object3D.d.ts:40
Optional name of the object (doesn't need to be unique).
default
''
# normalMatrix
• normalMatrix: Matrix3
Inherited from RoomleComponent.normalMatrix
Defined in node_modules/three/src/core/Object3D.d.ts:97
default
new THREE.Matrix3()
# onAfterRender
• onAfterRender: function
Inherited from RoomleComponent.onAfterRender
Defined in node_modules/three/src/core/Object3D.d.ts:203
Calls after rendering object
# Type declaration:
▸ (renderer
: WebGLRenderer, scene
: Scene, camera
: Camera, geometry
: Geometry | BufferGeometry, material
: Material, group
: Group): void
Parameters:
Name | Type |
---|---|
renderer | WebGLRenderer |
scene | Scene |
camera | Camera |
geometry | Geometry | BufferGeometry |
material | Material |
group | Group |
# onBeforeRender
• onBeforeRender: function
Inherited from RoomleComponent.onBeforeRender
Defined in node_modules/three/src/core/Object3D.d.ts:191
Calls before rendering object
# Type declaration:
▸ (renderer
: WebGLRenderer, scene
: Scene, camera
: Camera, geometry
: Geometry | BufferGeometry, material
: Material, group
: Group): void
Parameters:
Name | Type |
---|---|
renderer | WebGLRenderer |
scene | Scene |
camera | Camera |
geometry | Geometry | BufferGeometry |
material | Material |
group | Group |
# parent
• parent: Object3D | null
Inherited from RoomleComponent.parent
Defined in node_modules/three/src/core/Object3D.d.ts:51
Object's parent in the scene graph.
default
null
# position
• position: Vector3
Inherited from RoomleComponent.position
Defined in node_modules/three/src/core/Object3D.d.ts:69
Object's local position.
default
new THREE.Vector3()
# quaternion
• quaternion: Quaternion
Inherited from RoomleComponent.quaternion
Defined in node_modules/three/src/core/Object3D.d.ts:81
Object's local rotation as a Quaternion.
default
new THREE.Quaternion()
# receiveShadow
• receiveShadow: boolean
Inherited from RoomleComponent.receiveShadow
Defined in node_modules/three/src/core/Object3D.d.ts:143
Material gets baked in shadow receiving.
default
false
# renderOrder
• renderOrder: number
Inherited from RoomleComponent.renderOrder
Defined in node_modules/three/src/core/Object3D.d.ts:155
Overrides the default rendering order of scene graph objects, from lowest to highest renderOrder. Opaque and transparent objects remain sorted independently though. When this property is set for an instance of Group, all descendants objects will be sorted and rendered together.
default
0
# rotation
• rotation: Euler
Inherited from RoomleComponent.rotation
Defined in node_modules/three/src/core/Object3D.d.ts:75
Object's local rotation (Euler angles), in radians.
default
new THREE.Euler()
# scale
• scale: Vector3
Inherited from RoomleComponent.scale
Defined in node_modules/three/src/core/Object3D.d.ts:87
Object's local scale.
default
new THREE.Vector3()
# topDown
• topDown: boolean = false
Defined in packages/configurator-core/src/utils/text-with-background.ts:33
# type
• type: string
Inherited from RoomleComponent.type
Defined in node_modules/three/src/core/Object3D.d.ts:45
default
'Object3D'
# up
• up: Vector3
Inherited from RoomleComponent.up
Defined in node_modules/three/src/core/Object3D.d.ts:63
Up direction.
default
THREE.Object3D.DefaultUp.clone()
# userData
• userData: object
Inherited from RoomleComponent.userData
Defined in node_modules/three/src/core/Object3D.d.ts:167
An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned.
default
{}
# Type declaration:
- [ key: string]: any
# uuid
• uuid: string
Inherited from RoomleComponent.uuid
Defined in node_modules/three/src/core/Object3D.d.ts:34
# visible
• visible: boolean
Inherited from RoomleComponent.visible
Defined in node_modules/three/src/core/Object3D.d.ts:131
Object gets rendered if true.
default
true
# Static
DefaultMatrixAutoUpdate
▪ DefaultMatrixAutoUpdate: boolean
Inherited from RoomleComponent.DefaultMatrixAutoUpdate
Defined in node_modules/three/src/core/Object3D.d.ts:213
# Static
DefaultUp
▪ DefaultUp: Vector3
Inherited from RoomleComponent.DefaultUp
Defined in node_modules/three/src/core/Object3D.d.ts:212
# Methods
# add
▸ add(...object
: Object3D[]): this
Inherited from RoomleComponent.add
Defined in node_modules/three/src/core/Object3D.d.ts:319
Adds object as child of this object.
Parameters:
Name | Type |
---|---|
...object | Object3D[] |
Returns: this
# addEventListener
▸ addEventListener(type
: string, listener
: function): void
Inherited from RoomleComponent.addEventListener
Defined in node_modules/three/src/core/EventDispatcher.d.ts:27
Adds a listener to an event type.
Parameters:
▪ type: string
The type of event to listen to.
▪ listener: function
The function that gets called when the event is fired.
▸ (event
: Event): void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: void
# applyMatrix4
▸ applyMatrix4(matrix
: Matrix4): void
Inherited from RoomleComponent.applyMatrix4
Defined in node_modules/three/src/core/Object3D.d.ts:218
This updates the position, rotation and scale with the matrix.
Parameters:
Name | Type |
---|---|
matrix | Matrix4 |
Returns: void
# applyQuaternion
▸ applyQuaternion(quaternion
: Quaternion): this
Inherited from RoomleComponent.applyQuaternion
Defined in node_modules/three/src/core/Object3D.d.ts:220
Parameters:
Name | Type |
---|---|
quaternion | Quaternion |
Returns: this
# attach
▸ attach(object
: Object3D): this
Inherited from RoomleComponent.attach
Defined in node_modules/three/src/core/Object3D.d.ts:334
Adds object as a child of this, while maintaining the object's world transform.
Parameters:
Name | Type |
---|---|
object | Object3D |
Returns: this
# clear
▸ clear(): this
Inherited from RoomleComponent.clear
Defined in node_modules/three/src/core/Object3D.d.ts:329
Removes all child objects.
Returns: this
# clone
▸ clone(recursive?
: boolean): this
Inherited from RoomleComponent.clone
Defined in node_modules/three/src/core/Object3D.d.ts:382
Parameters:
Name | Type |
---|---|
recursive? | boolean |
Returns: this
# copy
▸ copy(source
: this, recursive?
: boolean): this
Inherited from RoomleComponent.copy
Defined in node_modules/three/src/core/Object3D.d.ts:389
Parameters:
Name | Type | Description |
---|---|---|
source | this | - |
recursive? | boolean |
Returns: this
# dispatchEvent
▸ dispatchEvent(event
: object): void
Inherited from RoomleComponent.dispatchEvent
Defined in node_modules/three/src/core/EventDispatcher.d.ts:47
Fire an event type.
Parameters:
▪ event: object
Name | Type |
---|---|
type | string |
Returns: void
# dispose
▸ dispose(): void
Defined in packages/configurator-core/src/utils/text-with-background.ts:151
Returns: void
# getObjectById
▸ getObjectById(id
: number): Object3D | undefined
Inherited from RoomleComponent.getObjectById
Defined in node_modules/three/src/core/Object3D.d.ts:340
Searches through the object's children and returns the first with a matching id.
Parameters:
Name | Type | Description |
---|---|---|
id | number | Unique number of the object instance |
Returns: Object3D | undefined
# getObjectByName
▸ getObjectByName(name
: string): Object3D | undefined
Inherited from RoomleComponent.getObjectByName
Defined in node_modules/three/src/core/Object3D.d.ts:346
Searches through the object's children and returns the first with a matching name.
Parameters:
Name | Type | Description |
---|---|---|
name | string | String to match to the children's Object3d.name property. |
Returns: Object3D | undefined
# getObjectByProperty
▸ getObjectByProperty(name
: string, value
: string): Object3D | undefined
Inherited from RoomleComponent.getObjectByProperty
Defined in node_modules/three/src/core/Object3D.d.ts:348
Parameters:
Name | Type |
---|---|
name | string |
value | string |
Returns: Object3D | undefined
# getWorldDirection
▸ getWorldDirection(target
: Vector3): Vector3
Inherited from RoomleComponent.getWorldDirection
Defined in node_modules/three/src/core/Object3D.d.ts:353
Parameters:
Name | Type |
---|---|
target | Vector3 |
Returns: Vector3
# getWorldPosition
▸ getWorldPosition(target
: Vector3): Vector3
Inherited from RoomleComponent.getWorldPosition
Defined in node_modules/three/src/core/Object3D.d.ts:350
Parameters:
Name | Type |
---|---|
target | Vector3 |
Returns: Vector3
# getWorldQuaternion
▸ getWorldQuaternion(target
: Quaternion): Quaternion
Inherited from RoomleComponent.getWorldQuaternion
Defined in node_modules/three/src/core/Object3D.d.ts:351
Parameters:
Name | Type |
---|---|
target | Quaternion |
Returns: Quaternion
# getWorldScale
▸ getWorldScale(target
: Vector3): Vector3
Inherited from RoomleComponent.getWorldScale
Defined in node_modules/three/src/core/Object3D.d.ts:352
Parameters:
Name | Type |
---|---|
target | Vector3 |
Returns: Vector3
# hasEventListener
▸ hasEventListener(type
: string, listener
: function): boolean
Inherited from RoomleComponent.hasEventListener
Defined in node_modules/three/src/core/EventDispatcher.d.ts:34
Checks if listener is added to an event type.
Parameters:
▪ type: string
The type of event to listen to.
▪ listener: function
The function that gets called when the event is fired.
▸ (event
: Event): void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: boolean
# localToWorld
▸ localToWorld(vector
: Vector3): Vector3
Inherited from RoomleComponent.localToWorld
Defined in node_modules/three/src/core/Object3D.d.ts:302
Updates the vector from local space to world space.
Parameters:
Name | Type | Description |
---|---|---|
vector | Vector3 | A local vector. |
Returns: Vector3
# lookAt
▸ lookAt(vector
: Vector3 | number, y?
: number, z?
: number): void
Inherited from RoomleComponent.lookAt
Defined in node_modules/three/src/core/Object3D.d.ts:314
Rotates object to face point in space.
Parameters:
Name | Type | Description |
---|---|---|
vector | Vector3 | number | A world vector to look at. |
y? | number | - |
z? | number | - |
Returns: void
# raycast
▸ raycast(raycaster
: Raycaster, intersects
: Intersection[]): void
Inherited from RoomleComponent.raycast
Defined in node_modules/three/src/core/Object3D.d.ts:355
Parameters:
Name | Type |
---|---|
raycaster | Raycaster |
intersects | Intersection[] |
Returns: void
# remove
▸ remove(...object
: Object3D[]): this
Inherited from RoomleComponent.remove
Defined in node_modules/three/src/core/Object3D.d.ts:324
Removes object as child of this object.
Parameters:
Name | Type |
---|---|
...object | Object3D[] |
Returns: this
# removeEventListener
▸ removeEventListener(type
: string, listener
: function): void
Inherited from RoomleComponent.removeEventListener
Defined in node_modules/three/src/core/EventDispatcher.d.ts:41
Removes a listener from an event type.
Parameters:
▪ type: string
The type of the listener that gets removed.
▪ listener: function
The listener function that gets removed.
▸ (event
: Event): void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: void
# rotateOnAxis
▸ rotateOnAxis(axis
: Vector3, angle
: number): this
Inherited from RoomleComponent.rotateOnAxis
Defined in node_modules/three/src/core/Object3D.d.ts:247
Rotate an object along an axis in object space. The axis is assumed to be normalized.
Parameters:
Name | Type | Description |
---|---|---|
axis | Vector3 | A normalized vector in object space. |
angle | number | The angle in radians. |
Returns: this
# rotateOnWorldAxis
▸ rotateOnWorldAxis(axis
: Vector3, angle
: number): this
Inherited from RoomleComponent.rotateOnWorldAxis
Defined in node_modules/three/src/core/Object3D.d.ts:254
Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.
Parameters:
Name | Type | Description |
---|---|---|
axis | Vector3 | A normalized vector in object space. |
angle | number | The angle in radians. |
Returns: this
# rotateX
▸ rotateX(angle
: number): this
Inherited from RoomleComponent.rotateX
Defined in node_modules/three/src/core/Object3D.d.ts:260
Parameters:
Name | Type | Description |
---|---|---|
angle | number |
Returns: this
# rotateY
▸ rotateY(angle
: number): this
Inherited from RoomleComponent.rotateY
Defined in node_modules/three/src/core/Object3D.d.ts:266
Parameters:
Name | Type | Description |
---|---|---|
angle | number |
Returns: this
# rotateZ
▸ rotateZ(angle
: number): this
Inherited from RoomleComponent.rotateZ
Defined in node_modules/three/src/core/Object3D.d.ts:272
Parameters:
Name | Type | Description |
---|---|---|
angle | number |
Returns: this
# setRotationFromAxisAngle
▸ setRotationFromAxisAngle(axis
: Vector3, angle
: number): void
Inherited from RoomleComponent.setRotationFromAxisAngle
Defined in node_modules/three/src/core/Object3D.d.ts:225
Parameters:
Name | Type |
---|---|
axis | Vector3 |
angle | number |
Returns: void
# setRotationFromEuler
▸ setRotationFromEuler(euler
: Euler): void
Inherited from RoomleComponent.setRotationFromEuler
Defined in node_modules/three/src/core/Object3D.d.ts:230
Parameters:
Name | Type |
---|---|
euler | Euler |
Returns: void
# setRotationFromMatrix
▸ setRotationFromMatrix(m
: Matrix4): void
Inherited from RoomleComponent.setRotationFromMatrix
Defined in node_modules/three/src/core/Object3D.d.ts:235
Parameters:
Name | Type |
---|---|
m | Matrix4 |
Returns: void
# setRotationFromQuaternion
▸ setRotationFromQuaternion(q
: Quaternion): void
Inherited from RoomleComponent.setRotationFromQuaternion
Defined in node_modules/three/src/core/Object3D.d.ts:240
Parameters:
Name | Type |
---|---|
q | Quaternion |
Returns: void
# toJSON
▸ toJSON(meta?
: object): any
Inherited from RoomleComponent.toJSON
Defined in node_modules/three/src/core/Object3D.d.ts:375
Parameters:
▪Optional
meta: object
Name | Type |
---|---|
geometries | any |
images | any |
materials | any |
textures | any |
Returns: any
# translateOnAxis
▸ translateOnAxis(axis
: Vector3, distance
: number): this
Inherited from RoomleComponent.translateOnAxis
Defined in node_modules/three/src/core/Object3D.d.ts:278
Parameters:
Name | Type | Description |
---|---|---|
axis | Vector3 | A normalized vector in object space. |
distance | number | The distance to translate. |
Returns: this
# translateX
▸ translateX(distance
: number): this
Inherited from RoomleComponent.translateX
Defined in node_modules/three/src/core/Object3D.d.ts:284
Translates object along x axis by distance.
Parameters:
Name | Type | Description |
---|---|---|
distance | number | Distance. |
Returns: this
# translateY
▸ translateY(distance
: number): this
Inherited from RoomleComponent.translateY
Defined in node_modules/three/src/core/Object3D.d.ts:290
Translates object along y axis by distance.
Parameters:
Name | Type | Description |
---|---|---|
distance | number | Distance. |
Returns: this
# translateZ
▸ translateZ(distance
: number): this
Inherited from RoomleComponent.translateZ
Defined in node_modules/three/src/core/Object3D.d.ts:296
Translates object along z axis by distance.
Parameters:
Name | Type | Description |
---|---|---|
distance | number | Distance. |
Returns: this
# traverse
▸ traverse(callback
: function): void
Inherited from RoomleComponent.traverse
Defined in node_modules/three/src/core/Object3D.d.ts:357
Parameters:
▪ callback: function
▸ (object
: Object3D): any
Parameters:
Name | Type |
---|---|
object | Object3D |
Returns: void
# traverseAncestors
▸ traverseAncestors(callback
: function): void
Inherited from RoomleComponent.traverseAncestors
Defined in node_modules/three/src/core/Object3D.d.ts:361
Parameters:
▪ callback: function
▸ (object
: Object3D): any
Parameters:
Name | Type |
---|---|
object | Object3D |
Returns: void
# traverseVisible
▸ traverseVisible(callback
: function): void
Inherited from RoomleComponent.traverseVisible
Defined in node_modules/three/src/core/Object3D.d.ts:359
Parameters:
▪ callback: function
▸ (object
: Object3D): any
Parameters:
Name | Type |
---|---|
object | Object3D |
Returns: void
# update
▸ update(position
: Vector3, dimensioningType
: number, label
: string, cameraPosition
: Vector3): void
Defined in packages/configurator-core/src/utils/text-with-background.ts:88
Parameters:
Name | Type |
---|---|
position | Vector3 |
dimensioningType | number |
label | string |
cameraPosition | Vector3 |
Returns: void
# updateMatrix
▸ updateMatrix(): void
Inherited from RoomleComponent.updateMatrix
Defined in node_modules/three/src/core/Object3D.d.ts:366
Updates local transform.
Returns: void
# updateMatrixWorld
▸ updateMatrixWorld(force?
: boolean): void
Inherited from RoomleComponent.updateMatrixWorld
Defined in node_modules/three/src/core/Object3D.d.ts:371
Updates global transform of the object and its children.
Parameters:
Name | Type |
---|---|
force? | boolean |
Returns: void
# updateWorldMatrix
▸ updateWorldMatrix(updateParents
: boolean, updateChildren
: boolean): void
Inherited from RoomleComponent.updateWorldMatrix
Defined in node_modules/three/src/core/Object3D.d.ts:373
Parameters:
Name | Type |
---|---|
updateParents | boolean |
updateChildren | boolean |
Returns: void
# worldToLocal
▸ worldToLocal(vector
: Vector3): Vector3
Inherited from RoomleComponent.worldToLocal
Defined in node_modules/three/src/core/Object3D.d.ts:308
Updates the vector from world space to local space.
Parameters:
Name | Type | Description |
---|---|---|
vector | Vector3 | A world vector. |
Returns: Vector3