Class: DebugText experimental
debugBeta
A debug shape class that represents a text label in the world with a background.
Extends
Constructors
Constructor
new DebugText(
location,text):DebugText
Beta
Parameters
location
any
text
any
Returns
DebugText
Overrides
DebugShape.constructor
Properties
attachedTo?
optionalattachedTo?:any
Beta
Remarks
此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。
The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset.
Inherited from
backfaceVisible
backfaceVisible:
boolean
Beta
Remarks
If set to true, the debug text will render the back-face of the background. Defaults to true but will always be false if 'useRotation' is set to false.
backgroundColorOverride?
optionalbackgroundColorOverride?:any
Beta
Remarks
The color of the background plate of the text. If set to undefined, it will use the default color.
color
color:
RGBA
Beta
Remarks
形状的颜色。
The color of the shape.
Inherited from
depthTest
depthTest:
boolean
Beta
Remarks
If set to true, the text will be hidden behind blocks or entities. By default this is set to false (will always render).
dimension
readonlydimension:Dimension
Beta
Remarks
该形状可见的维度。如果该维度未定义,则会在所有维度中显示。
The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions.
Inherited from
hasDuration
readonlyhasDuration:boolean
Beta
Remarks
如果形状在被移除之前具有有限的时间跨度,则返回 true。
Returns true if the shape has a limited time span before being removed.
Inherited from
lineGapHeight
lineGapHeight:
number
Beta
Remarks
This value determines the gap between lines for the debug text. By default the line gap height is 0.
location
readonlylocation:Vector3
Beta
Remarks
形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。
The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line.
Inherited from
maximumRenderDistance?
optionalmaximumRenderDistance?:number
Beta
Remarks
如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。
If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting.
Minimum Value: 0
Inherited from
DebugShape.maximumRenderDistance
rotation
rotation:
Vector3
Beta
Remarks
形状的旋转(欧拉角 - [俯仰角,偏航角,滚转角])。
The rotation of the shape (Euler angles - [Pitch, Yaw, Roll]).
Inherited from
scale
scale:
number
Beta
Remarks
形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。
The scale of the shape. This does not apply to DebugLine or DebugArrow.
Inherited from
text
readonlytext:any
Beta
Remarks
Get the text of the debug text shape. Returns the RawText of
the debug text if setText was called with a RawMessage or
a RawText object, otherwise returns a string.
textBackfaceVisible
textBackfaceVisible:
boolean
Beta
Remarks
If set to true, the debug text will render the back-face of the text. Defaults to true but will always be false if 'useRotation' is set to false.
timeLeft?
optionaltimeLeft?:number
Beta
Remarks
此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。
The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span.
Inherited from
totalTimeLeft?
readonlyoptionaltotalTimeLeft?:number
Beta
Remarks
直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。
The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span.
Inherited from
useRotation
useRotation:
boolean
Beta
Remarks
If set to true, the text will not face the camera and instead will use the rotation from the shape.
visibleTo
visibleTo:
Player[]
Beta
Remarks
可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。
The list of players that this shape will be visible to. If left empty, the shape will be visible to all players.
Inherited from
Methods
remove()
remove():
void
Beta
Returns
void
Remarks
从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。
Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method.
Inherited from
setLocation()
setLocation(
location):void
Beta
Parameters
location
any
Returns
void
Remarks
设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。
Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line.
Inherited from
setText()
setText(
text):void
Beta
Parameters
text
any
Returns
void
Remarks
Sets the text to display.
Throws
This function can throw errors.
