@minecraft
    正在准备搜索索引...

    类 TextPrimitive实验性

    A primitive shape class that represents a text label in the world with a background.

    层级 (查看层级一览)

    索引

    构造函数

    属性

    attachedTo?: Entity

    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.

    backfaceVisible: boolean

    If set to true, the text primitive will render the back-face of the background. Defaults to true but will always be false if 'useRotation' is set to false.

    backgroundColorOverride?: RGBA

    The color of the background plate of the text. If set to undefined, it will use the default color.

    color: RGBA

    The color of the shape.

    depthTest: boolean

    If set to true, the text will be hidden behind blocks or entities. By default this is set to false (will always render).

    dimension: Dimension

    The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions.

    hasDuration: boolean

    Returns true if the shape has a limited time span before being removed.

    location: Vector3

    The location of the shape.

    maximumRenderDistance?: number

    If defined, this distance will be used to determine how far away this primitive will be rendered for each client. By default the distance will match the client's render distance setting.

    Minimum Value: 0

    rotation: Vector3

    The rotation of the shape (Euler angles - [Pitch, Yaw, Roll]).

    scale: number

    The scale of the shape.

    Bounds: [-1000, 1000]

    text: string | RawMessage

    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: boolean

    If set to true, the text primitive will render the back-face of the text. Defaults to true but will always be false if 'useRotation' is set to false.

    timeLeft?: number

    The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span.

    totalTimeLeft?: number

    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.

    useRotation: boolean

    If set to true, the text will not face the camera and instead will use the rotation from the shape.

    visibleTo: Player[]

    The list of players that this shape will be visible to. If left empty, the shape will be visible to all players.

    方法