Skip to main content

<pc-screen>

The <pc-screen> tag is used to define a screen component.

Usage

Attributes

AttributeTypeDefaultDescription
blendBoolean"false"Whether to enable alpha blending
enabledBoolean"true"Enabled state of the component
priorityNumber"0"Rendering priority (0-255)
reference-resolutionVector2"640 320"Reference resolution as "Width Height" values
resolutionVector2"640 320"Screen resolution as "Width Height" values
scale-blendNumber"0.5"Scale blending factor (0-1)
screen-spaceBoolean"false"Whether to render in screen space

Example

<pc-app>
<pc-asset src="assets/fonts/arial.json" type="font" id="arial"></pc-asset>
<pc-scene>
<pc-entity>
<!-- define a 2d screen -->
<pc-screen></pc-screen>
<!-- render some text on the parent screen -->
<pc-entity>
<pc-element type="text" font-asset="arial" text="Hello, World!"></pc-element>
</pc-entity>
</pc-entity>
</pc-scene>
</pc-app>

JavaScript Interface

You can programmatically create and manipulate <pc-screen> elements using the ScreenComponentElement API.