Skip to main content

<pc-element>

The <pc-element> tag is used to define an element component.

note

Attributes

AttributeDescription
anchorThe anchor of the element component. Specified as a space-separated list of X, Y, Z, and W values. If not specified, 0 0 0 1 is used.
assetA string that should match the id of a <pc-asset> tag that has a type of font.
auto-widthValueless attribute. If present, the element component automatically adjusts its width.
colorThe color of the element component. Can be a space-separated list of R, G, B, and A values, a hex color code, or a named color. If not specified, 1 1 1 1 is used.
font-sizeThe font size of the element component. If not specified, 16 is used.
line-heightThe line height of the element component. If not specified, 1.2 is used.
pivotThe pivot of the element component. Specified as a space-separated list of X and Y values. If not specified, 0.5 0.5 is used.
textThe text of the element component.
typeThe type of element component. Can be group, image or text. If not specified, group is used.
widthThe width of the element component. If not specified, 0 is used.
wrap-linesValueless attribute. If present, the element component wraps lines.

Example

<pc-entity>
<pc-element type="text" asset="arial"text="Hello, World!"></pc-element>
</pc-entity>

JavaScript Interface

You can programmatically create and manipulate <pc-element> elements using the ElementComponentElement API.